Animation controller script


I find a example script called MecanimBridge.cs to connect my blend tree animations, i am not good at the 3d calculate in unity so I don’t understand the velocity calculation in that script and that’s make the “Parameters” from my ai enemys’ Mechanim animation doest not match the output values. for that, is there’s a way on how to setup the blend tree parameters in oder to match output values from that MecanimBridge.cs script?


I haven’t been able to include a fully animated character because it’s been tricky to find a good character with good animations that also have a license that permits me to redistribute it.
This is a video showing what a character looks like with the MecanimBridge script:

Did you check the documentation for the script? It has this section:

  • InputMagnitude which is simply 1 when the character should be moving and 0 when it should stop.
  • X which is component of the desired movement direction along the left/right axis.
  • Y which is component of the desired movement direction along the forward/backward axis.

yes, I read these text, the Y axis works fine which seems I can use the maxSpeed from the RichAI.cs to control the output value to match my walk and run animation, but the X axis returns weird number like 0.00003… something like this, for this , let say if I have a turn animation for example turning 45 degree then I don’t know how to make this number match the parameters from the animator.

Also, I am using the Behavior Designer asset from Opsive in my project, and except the problem above , I am facing few more problems, to make these problem clear, I have setup a simple blend tree animator with only the walk and run animation link up with the MecanimBridge.cs to do the root motion and I am using the Raycast Graph and the RichAI.cs script for the navigation, for this, I record a short video, please click the blew link for your reference.

In this video, I think I have two problems, please allow me to list the problem below.

1.During the Patrol mode, the enemy character willl turn himself one around before he sets a new path to the next destination.

2.In the Chase mode, the enemy will get stuck somewhere and also turning around on that position.

I have no idea why this is happening, please assist me to solve this problem.
Thank you!