Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Start()
- {
- }
- void Update()
- {
- if(Input.GetMouseButtonDown(1))
- {
- TerraformClick = 1;
- }
- }
- void Awake()
- {
- GameObject TerraformButt = GameObject.Find("Terraform");
- Terraform terraformScript = TerraformButt.GetComponent<Terraform>(); //finding the object
- }
- void Update()
- {
- //probably some mistake in calling the variable
- if (Terraform.TerraformClick == 1)
- {
- Vector3 pz =
- Camera.main.ScreenToWorldPoint(Input.mousePosition);
- pz.z = 0;
- transform.position = pz;
- }
- else {
- }
- }
Add Comment
Please, Sign In to add comment