- Home /
Having issues with webgl and animations
I set up my characters animation to fire off a hit animation lock the position and then check the animation normal time (when it's over) to unlock the movement.
Fire animation -> when(!animationOver) LockMovement()
protected async Task IsAnimFinished(string name)
{
var isFinished = false;
while (!isFinished)
{
if (animator.GetCurrentAnimatorClipInfo(0)[0].clip.name == name && !animator.IsInTransition(0) && animator.GetCurrentAnimatorStateInfo(0).normalizedTime >= 0.98f)
{
isFinished = true;
}
await Task.Yield();
}
return;
}
But when I build the game and push it to webgl and tab around to other tabs the animation never triggers as over, so the character is constantly locked with some bug.
At first I thought this was an issue with animation culling so I set to "Always animate" but that's still throwing the error. Any ideas?
Your answer
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
Add a Cloth Simulation to WebGL 0 Answers
Unity 5.3 WebGL StateMachineBehaviours not executing. 2 Answers
How to select an animation clip by index number? 7 Answers
TextureFormat.RGBAHalf with WebGL 0 Answers