I have been trying to develop a Legends of Zelda game for a while. One of the core functionality is to have NPC and the boss in the boss level roam their Arenas before spotting Link. I was very unhappy with the way the NPCs looked when the animation followed the animation (caused the gliding effect of the feet, which is well documented and the fix is readily available on the unity manual in this link here.(I am using the “if you want the agent to follow the character” part.)) The problem now is that I have not been able to find a single forum post or a YouTube video discussing this, is that the nav mesh agent settings are all now useless. In fact, not only are they useless, but changing anything from character speed, acceleration, and angular speed from the nav mesh agent all break the patrolling behavior of the agent. It is noteworthy that I have copied and pasted all the code for both patrolling and the animation coupling from the manual, but it still completely breaks and I cannot find a way to make my character walk during patrolling instead of running.
I am using the patrolling script found here.
For animations, I am using a blend tree-like referred to in the unity tutorial that blends walking, running, and turning.It is working fine and is working just as expected. So far, due to the high velocity of the agent trying to reach the waypoints, the NPCs are always running. Trying to divide the velocity calculated by an arbitrary float also leads to breaking the patrolling behavior somehow. I have tried to brute force by dividing everything and anything but any constants (such as dividing velx and vely by any constant) but the result is always the same. It leads to either the animation jittering and not being acceptable at all, or leads to the agent completely going off course during patrolling. If anyone knows any way to modulate the speed of patrolling without breaking anything or if there is a standard way of modulating agent speed after applying this animation coupling where the agent follows the character animation, I am all ears and greatly appreciate your help. Thank you all for your time in advance.