Delay when activating gameobject and calling Animator.Play() at the same time
Hi !
I'm facing an issue with the animator. When a gameobject using one is inactive, the animator is resetted to its default state and starts to Entry when the gameobject in activated. So I call Animator.Play() to play the animation I need but you can still see for one frame the character standing before being seated the next. Gameobject.SetActive(true) and Animator.Play() are called on the exact same frame.
It's really annoying because it's clearly visible when it happens. I already though of just disabling the renderer instead of the gameobject, but I do this as part of a custom LODing system where LOD1 are pre-rendered mesh from a skinned mesh renderer is maximize performances.
My questions are, is it normal that calling Gameobject.SetActive(true) and Animator.Play() cause a delay ? And if so, do you have any suggestions on how to play an animation at the exact same frame when the gameobject is activated ?
Thank you !
Like always, no one can give an answer. Like in stackoverflow, when you ask a real question no one dare to give a reply.
hello, you should have posted this question in the default room, not in the help room. Anyway the behaviour you are experiencing is weird, since gameobject setactive and animator play are completly syncronous methods, maybe you have one start frame in wich the animation is played? I have just tested a simple animation changing colors and im unable to replicate
Your answer
Follow this Question
Related Questions
Animation render position 0 Answers
Help with 8-DOM Weapon Sprite Issue 0 Answers
Humanoid Animations 0 Answers
How to make player rotate 180° and run that direction with mecanim + vice versa? 1 Answer
Animator vs Animation Clip via Scripting 0 Answers