I'm trying to implement shooting using a physics raycast. This is what I should do, as far as I know [please correct me if I have the wrong idea]
When the player clicks the mouse, I need to cast a ray from the camera position and at the camera angle to all shapes. Then I check to see if it hit any object using the get ray cast hit command. if it does, i check to see whether it hit an enemy [get ray cast object, if between 150 and 160 it hit an enemy] and if it did, i delete the enemy.
So theres my understanding of a shooting function. Here's my problem: when I ray cast all shapes, I get the following error:
NxRay: direction not valid, must be unit vector.
this is the line that casts the ray.
temp = phy ray cast all shapes( camera position x(), camera position y(), camera position z(), camera angle x(), camera angle y(), camera angle z())
If anyone has any suggestions, please let me know. Thanks!
--
Zhent, coding newbie