"Animators.applyOnAnimatorMove" Run high on Profiler

Shanmukh

New member
UCC Animator Problem.JPG
I used 8 AI Agents. Animators.applyOnAnimatorMove takes half of the time on profiler, How to rectify The problem.
 

Shanmukh

New member
i put a simple idle animation only also not working.
when i disable Ultimate Character Locomotion script. profiler runs smoothly.
it taking Ultimate Character Locomotion.OnAnimatorMove()Capture 2.JPG
 

Justin

Administrator
Staff member
It looks like OnAnimatorMove is being called 77 times. If you're running version 2.1.10 of the controller you can change the animator component so it updates within Update rather than AnimatePhysics. You could also cull update transforms so when the character isn't in view it doesn't update.

In version 2.2 you'll also be able to update the controller within Update instead of FixedUpdate which will help for lots of characters.

1581698428627.png
 

Shanmukh

New member
Thank u Justin its working.
its became 77 times to 12 times.
but still it takes 0.4ms for "UltimateCharacterLocomotion.OnAnimatorMove()" for each instance. is there any option for optimise ?.
 

Justin

Administrator
Staff member
.4ms running 12 times is .03ms a time. That seems normal if you have everything turned on. What you could do now is look at the call stack of what is taking the longest and then disable that individual feature if you don't need it (such as IK).
 

Shanmukh

New member
Thank u Justin. But it's not ".4ms running 12 times is .03ms a time ".
its 0.4ms for each instance total 4.1ms.
and is FinalIk can Solve This Problem?.
because i am making a mobile game.
 

Justin

Administrator
Staff member
The kinematic object manager will be able to be switched to Update in version 2.2 so that will help there, but unfortunately there isn't much that can be done for OnAnimatorMove right now. This is a situation where the job system will really shine. I have plans to switch to this but it'll take some time.

For right now you have a few options:

1. Disable horizontal/vertical collision detection for your AI. With a NavMeshAgent you'll likely be able to disable horizontal collisions, but will likely need vertical collisions.
2. Remove any abilities that you don't need.
3. Disable IK to see the performance differences.
4. Try turning on Auto Sync Transforms on the Kinematic Object Manager. This may lead to worse performance but it's worth a try.
5. Depending on the complexity of your AI, you may be able to not use the character controller at all and go with your own solution with just BD and the navmesh.
 
Top