Forum rules - please read before posting.

NPC Agent doesn't move on from destination area with Stopping Distance

edited October 2024 in Technical Q&A

Hello, I'm a newcomer to Adventure Creator, I have a problem where I have an issue about an NPC Agent not completing its ActionList Node for Character: Move along path. I've set up the NPC in a way that it has a Nav Mesh Agent component with its Stopping Distance set to 2, and move to a GameObject with Colliders enabled.

Expectations: Have the NPC moved to that destination. When it stops at a certain point near the destination due to the Stopping Distance, Adventure Creator should recognize it as an action complete and it would move on to the next Action or stop completely(up to my choice). If I choose to make it stop after that action, the Walking/Running Animation should stop as well.

Reality: NPC moved to that destination and stops at a certain point near it due to stopping distance but animation still plays its Walking/Running Animation and Adventure Creator still doesn't recognize it as a complete action.

I'm using Adventure Creator 1.79.3 and Unity 2021.3.24f1

Comments

  • Welcome to the community, @VaporaLight7.

    Do you also have AC's "NavMesh Agent Integration" component attached? How large is your character, in Unity units?

    It may be a case of the stopping distance not matching up with AC's own "Destination accuracy" slider in the Settings Manager, which affects how "close" a character needs to be before considered "close enough". Try lowering this slider value to see if that affects it.

    Details on this topic can be found in the Manual's "Precision movement" chapter, but if you can share screenshots of your scene, the NPC Inspector, and your Settings Manager, I'll take a look as well.

  • edited October 2024

    Thank you Chris for the swift response, Yes, I do have Nav Mesh Integration component in my NPC Agent, My character is around this big.

    Here are my NPC's Inspector:

    I see so I need to check Destination Accuracy slider in the Settings Manager. (Edited: my images arent displaying properly despite using dropbox links).

  • edited October 2024

    (Edited: there was suppose to be a picture here but its blank in my case. I tried clicking that image icon near the field and insert the url but nothing shows up).

  • Image urls don't typically work from Dropbox - you can either share links as text, or upload to imgur.com and link from there.

    Yes, try reducing the Destination accuracy, or the Stopping Distance.

  • Oh so thats why my links aren't working but maybe this link will work.
    NPC Inspector:
    https://imgur.com/a/npc-inspector-7LuZsNn

    Character Size:
    https://imgur.com/a/Fgp0wz2

    Video:
    https://imgur.com/a/EZYaWV9

    Let me know if you find anything wrong with my images.

  • Ok, I've set my Destination Accuracy to 0 and a Stopping Distance of 1.85. It works for smaller objects like the cube you are seeing in the video but doesn't do well with larger objects like the Larger Cube you see in the video. Is there any way to have it a one size fit all scenario?

    https://imgur.com/a/r1mDn3c

  • Sorry, I'm not clear on what's going on with the cubes - are they obstacles you're clicking inside to have the Player attempt to move there? What does the NavMesh itself look like?

    There's a difference with a character being blocked from moving somewhere due to the NavMesh not reaching it, vs a Collider preventing their motion. If you use the latter, the game won't understand that they're not able to reach it.

    The Character: Move to point Action has Minimum distance and Enforce time limit options to cancel its waiting behaviour in the event that either the character gets close enough, or takes too long, respectively. However, it's best to ensure that any position they are commanded to move can be reached on the NavMesh. If you bake the cubes into the NavMesh, so that they carve out their shapes into it, you should get better results.

  • Oh sorry for not being clear. The cubes are a visual aid to determine where the waypoint is as its easier to see something if it has a shape. It was originally intended to be just a guide for the NPC to move to an unoccupied space in the game world. Recently, I've been trying out different ways to make use of it. One of it is using it on an actual game object that the NPC can go to but maintain a few distance from it so that it wont collide to it and struggle to reach a destination it cant reach.

  • The earlier mention of Destination accuracy / Stopping Distance may be unnecessary - it looks like the cubes are blocking the NPC's ability to reach their intended destination.

    You can prevent the Cube from interfering this way by checking Is Trigger in the Box Collider components so that they don't physically block the character.

  • Alright, I think theres one more thing I need to ask. Is it possible for GameObjects like tables, desk, people, and etc be waypoints without colliding into them that much and stop when they reach a certain vicinity?

  • You can use them, just bake your NavMesh such that stationary objects are included, so that the NavMesh itself doesn't go underneath them and the edges of the NavMesh surround them. When an NPC move to them, they'll then set their destination as the closest point to them on the NavMesh (i.e. on the edge around them, not at their exact position).

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.