Search Unity

Any way to update only the Animator State even if the gameobject isn't culled ?

Discussion in 'Animation' started by manutoo, Apr 21, 2019.

  1. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    524
    Hello,

    I'd like to update the animator State, but not the actual transforms of the attached gameobjects. Like when using AnimatorCullingMode.CullCompletely and the gameobjects are culled out, but in this case my gameobjects are visible on the screen.

    Is there any way to do that ?

    My use case, if you wonder : I'm using prediction in a network game to show the near future to hide the lag effect. So there are 2 animators : the sure one, and the predicted one. The predicted one may need to advance in time several time within the same frame, and thus there's no need to update the transforms except on the final state.

    I guess the simplest solution would be to have an animator far from the camera, so I could control its behaviour with AnimatorCullingMode, and then copy over its transforms to my object on the screen, but I wonder if there's a cleaner and more efficient way to do that.

    Thanks in advance for any tip ! :)