- Home /
This question was
closed May 07, 2018 at 08:14 AM by
Myth for the following reason:
The question is answered, right answer was accepted
Question by
Myth · May 24, 2011 at 09:17 AM ·
raycastraycasthit
Raycast Coding Issues
this code is suppost to test if something is below the test point. It does this ONCE. How do I get it to reset?
function Update () { var hit : RaycastHit;
if (Physics.Raycast (transform.position, -Vector3.up, hit, 3) != null)
{
SendMessageUpwards ("conector", true);
}
else
{
SendMessageUpwards ("conector", false);
}
}
Comment
Best Answer
Answer by Antony-Blackett · May 24, 2011 at 09:50 AM
Physics.Raycast () doesn't return a nullable type. It returns boolean. Check if the result is true or false rather than null.