Guest User

Untitled

a guest
Feb 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. void Start()
  2. {
  3.  
  4. }
  5.  
  6. void Update()
  7. {
  8. if(Input.GetMouseButtonDown(1))
  9. {
  10. TerraformClick = 1;
  11. }
  12. }
  13.  
  14. void Awake()
  15. {
  16. GameObject TerraformButt = GameObject.Find("Terraform");
  17. Terraform terraformScript = TerraformButt.GetComponent<Terraform>(); //finding the object
  18.  
  19. }
  20.  
  21. void Update()
  22. {
  23. //probably some mistake in calling the variable
  24. if (Terraform.TerraformClick == 1)
  25. {
  26. Vector3 pz =
  27. Camera.main.ScreenToWorldPoint(Input.mousePosition);
  28. pz.z = 0;
  29. transform.position = pz;
  30. }
  31. else {
  32.  
  33. }
  34.  
  35. }
Add Comment
Please, Sign In to add comment