I have a ball with radius .15, I am trying to cast a ray forward from its center with distance .2 and if it hits something I want that somethings information. This is the line of code Physics.Raycast(down.position, down.forward *.2, hit, 1)
it is in an if statement, and it doesn’t work. When I press play the ray seems to reach out too far and hit other objects, so either I am doing this wrong(and I have tried the many versions of Raycast) or the scale of the scene is different which I dont think is the case because I draw a ray with all the same properties and it only extends .2. So anyone know Rays better than I do?
EDIT: I’ve added a picture. The green ray, is what is what the ray is supposed to be doing. The two highlighted objects are gate1 and gate2, and red ray is the result when I try Debug.DrawRay(hit.point, hit.point, Color.red, 120);
the game seems to think that “hit” in this case is gate2, and completely ignores gate2
[3508-screen+shot+2012-09-14+at+4.06.27+pm.png|3508]