|
I'm trying to create a raycast for my enemy so if the player is behind a wall, the enemy will not attack...this is what im currently using inside my update function:
The problem im having is that when i play the game, if the player is in range of the enemy but standing still, the enemy will not attack...but if i start moving, thats when the enemy starts to attack...All im trying to get accomplished is to have the enemy disengage when the player is either behind a wall or out of range with the use of raycast...I also tried using linecast and i was getting the same result...
(comments are locked)
|
|
You make the call to Physics.Raycast() outside of any function. I think you should move it to Update() to let the enemy constantly check for the player instead of just once. Still I can't explain why the enemy starts to attack when the player moves. The call to raycast IS in my update function but still only attacks when the player is moving....please anybody
Oct 30 '10 at 04:18 PM
John 17
(comments are locked)
|
untested
(comments are locked)
|
