Quantcast
Channel: Answers by "belvita"
Viewing all articles
Browse latest Browse all 91

Answer by belvita

$
0
0
Can u try like this: inside update function if (Input.GetMouseButtonDown(0)) { // when button clicked... gui = "no"; } RaycastHit hit; // cast a ray from mouse pointer: Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); // if enemy hit... if (Physics.Raycast(ray, out hit)) { Debug.Log("selecting"); DeselectPlanet(); // deselect previous target (if any)... selectedPlanet = hit.transform; // set the new one... planetselect(); // and select it }

Viewing all articles
Browse latest Browse all 91

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>