Quantcast
Channel: Answers for "Make AI walk around randomly until Player is Seen. (C#)"
Viewing all articles
Browse latest Browse all 4

Answer by SAE_Superman

$
0
0
Collision detection is your friend. Simply add a trigger collision volume to your characters. This way you can detect when characters enter, stay in or exit that "field of view". Inside the OnEnter, turn on the follow behavior and inside the OnExit, turn on the wander behavior. Being a maze, you might be able to "see through walls", but you can fix this by having a unique ID for each "corrider" or "hallway" and do a simple ID check to see if who you are seeing is in the same hallway. There are other ways (better but also more complex) to fix this issue too though.

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images