- Home /
Performance Issue When Applying animator.rootRotation
Hi there,
I'm having a performance issue with root motion driven characters, specifically with the following code, which is needed when using Mecanim with the NavMeshAgent.
void OnAnimatorMove()
{
navMeshAgent.velocity = animator.deltaPosition/Time.deltaTime;
transform.rotation = animator.rootRotation;
}
The profiler looks like this with 32 characters in the game:
This seems like way too much for just setting a rotation.
Is there anything I can do to help performance?
setrotationperformance.png
(41.9 kB)
Comment