Hello,
I am posting about a point and click behavior I cannot figure out:
When my player runs into an NPC which has a capsule collider, he, logically, cannot go through but his animation is stuck to "walking".
Is there a way to disable the animation when the player colides with an NPC?
Thank you.
Navmesh generated and working properly/ AC 1.73.8 / Unity 2021.1.16f1
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @pawnee.
Is this a result of the Player moving due to pathfinding (Point And Click movement), or direct input from the Player (Direct movement)?
Characters with the Mecanim animation engine have a Slow movement near walls option in their Inspector, that allows you to reduce their movement speed when near objects on a certain layer. If your movement speed is tied to their animation (most visible when using a Blend Tree to transition between Idle and Walk), you should be able to see a difference after tweaking the settings a little.
Otherwise, if pathfinding is involved, you may have luck using e.g. a NavMesh Obstacle component on your NPC if they are stationary. You'd also need to rely on NavMesh Agent / NavMeshAgent Integration components for your Player, but that may prevent the Player from moving through the NPC in the first place.
Thank you ChrisIceBox.
It's a result of pathfinding, I followed your advice and yes, NavMesh Obstacle does the trick. Since most are stationary, that's the best way.
Thank you again for your reply and this amazing asset.