Answers for "3d mouse raycast object hit name"

0

3d mouse raycast object hit name

if ( Input.GetMouseButtonDown (0)){ 
   RaycastHit hit; 
   Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); 
   if ( Physics.Raycast (ray,out hit,100.0f)) {
     StartCoroutine(ScaleMe(hit.transform));
     Debug.Log("You selected the " + hit.transform.name); // ensure you picked right object
   }
 }
Posted by: Guest on February-24-2021

Browse Popular Code Answers by Language