Forum rules - please read before posting.

Character evasion in 3D

Hi. Probably an easy one, but I couldn't find a way. I've been using AC for 2d and recently started to experiment with 3d. I am using point&click movement + navmesh segments and I'm trying for my player to avoid NPCs. It pushes them by default. I'm aware that I can have the NPC keep out of players way, but I was wondering about something similar to character evasion in 2d. I made sure to have a non zero pathfinding update time, and it still pushes the NPCs. I can check "is kinematic" on the NPC RigidBody so that it doesn't get pushed around, but then when the player runs into it, it just stops there.

Comments

  • edited July 2020

    You needn't rely on NavMesh Segments for 3D navigation - they're just a convenience tool. Any mesh placed on the NavMesh layer and baked in Unity's Navigation window can act as a floor.

    Dynamic evasion in 3D is a complex topic, and AC relies on Unity's own pathfinding components for navigation in 3D. The NavMesh Obstacle component has the option to carve themselves out of the NavMesh when stationary - attaching it to your NPC should prevent the Player from moving through them.

    You may also want or need to have your characters rely on Unity's own NavMesh Agent component for better integration with Unity's pathfinding. To do so, just attach both that and AC's "NavMesh Agent Integration" component to have them be compatible with both systems.

  • Great, the navmesh obstacle component was just what I needed. Thank you, Chris!!

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.