im trying to cast a ray from my player that will detect object it touches a certain length in front of him. i swear my code is fine but i cant get it to work
help would be great :)
EDIT ANOTHER PROBLEM.....
HELP PLEASE... @Bunny83
I would say your problem is your direction. If you use Raycast with a length the direction is normalized! That means your ray is 0.1 units long. But if you draw your ray with
answered Apr 21 '11 at 09:58 AM
i think you forgot the hit :
hope it works
have you attached it to the right player? if you still can not get it to work send it to me to my e-mail and i can look at it for you. the project folder this is.
i hope to hear from you :)
try my code:
instead of having animation you could have Destroy the object if you want to do that i would be like this:
and that should destroy the game object you can do what ever you like :)