Forum rules - please read before posting.

Player walks over NPC

Hello!

When I click on my NPC to move towards them, the player gets too close and will walk over them, as in going up in the Y axis as if it's avoiding the collider. Normally I would have a static obstacle on the floor so the player cannot click on the navmesh where that NPC is but with a couple of them I cannot.

I am using the following for both Player and NPC
Animation engine: Mecanim
Motion control: Automatic

I have tried various settings of the Physics settings but either I will be able to push the NPC out of the way or I will walk over the NPC.

Unity 2019.4.29F1
AC 1.73.2

Thanks!

Comments

  • The "Carve When Stationary" option of the NavMesh Obstacle component may help you here. That will update the NavMesh when the object it's attached to isn't moving, effectively cutting a hole around it.

    Otherwise, it may have to be a case of relying on a custom script that modifies the Player's path if the destination is too close to the NPC.

  • Adding a "Nav Mesh Obstacle" and choosing the "Carve When Stationary" did solve my problem. Thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.