void BuildingCallout() {
RaycastHit hit = new RaycastHit();
Ray ray = new Ray();
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Input.GetMouseButtonDown (0)) //Returns true during the frame the user touches the object
{
Debug.Log("mouse down");
if (Physics.Raycast (ray, out hit))
{
Debug.Log("pew pew");
if (hit.collider.gameObject.name.Equals("BrooksCallOut"))
{
Debug.Log("go brooks");
BrooksCallOut.gameObject.SendMessage("gotoBrooks");
}
}
}
else {
}
}
So here's my code. Its pretty strait foward, a raycast looks to the collider and if it hits a specific gameObject, it executes the function "gotoBrooks". I don't get any errors when I run the script but in the player, not a single one of the debug logs print. Does anyone have any idea what could be going on?