Question by
FrancescoDiTommasoSWCG · Mar 28, 2018 at 07:36 PM ·
navmeshnavmeshagentfollow playeravoidanceavoid
How do I make enemies that avoid player?
Hi, I'm making a tps isometric shooter. I've a scene with the player e some enemies.
The player is controlled with a virtual joystick which gives the player direction. The movement is provided using the rigidbody's velocity.
Every enemy in the scene has a navMeshAgent, which is used to follow the player avoiding static obstacle in the scene, like columns and walls. The obstacles don't have a navMesh obstacle component. I've used a navMeshSurface to bake the walkable surface of the level.
The enemies follow correctly the player, avoiding walls and columns but I want that they avoid the collision with the player too. I need that, if the player is too close, they move back.
How can I make it?
Comment