|
I am building a simple line of sight script in unity using javascript and on a flat plane it works just fine. However on terrain i get some issues mainly the object can't seem to see the player. Is there an adjustment i can make for this? right now this is the code i have for detecting the player: any help would be great. thanks.
(comments are locked)
|
|
The ray is probably coming from your feet, which means it hits the ground if the ground has the smallest of bumps on it. To test, can add a Just pick a spot on the player where the "eyes" are, and a spot to look at on the enemy (if you use This is crude, but works for manlike things (I'm saying the eyes are always 1.2 meters up from the feet.) You could child an empty in front of the player's head to be the eyes, and use: this kind of worked, but still same results the enemy only seems to see me when i back up and not move towards it. on a flat plane they see me all the time and i've checked the ray and it's a line directly to the player head and nothing is in the way. anything else you can think of that may be causing issues?
Apr 24 '12 at 05:32 PM
kievar1983
Figure out what the raycast is telling you. Maybe toss in a global string and set it to
Apr 25 '12 at 12:23 AM
Owen Reynolds
(comments are locked)
|
