Hello. This script is supposed to detect when the user’s mouse cursor comes into contact with a collider that has the tag “Finish” and then print something in the console. But, when I try to do that, nothing appears in the console, what is wrong? Thanks
function Update ()
{
var myObject : GameObject;
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
var hit : RaycastHit;
if (Physics.Raycast (ray, hit, 100)) {
if(hit.transform.tag == "fFinish"){
Debug.Log ("Hello");
// myObject = hit.transform.gameObject;
}
}
}