I have an animation that scales an object down when it 'sleeps'
When the object wakes back up again, there is a 'wake' animation that scales the object back up to normal.
When the object sleeps, I also set it's game object as inactive. When it wakes up I set it as active.
The first time that this animation plays, the object stays at the normal scale.
However, When it wakes up after dying, the wake animation plays, but the scale does not stay. The object scales back down immediately after the animation for some reason.
Here is my animator component on the object:
Is there a better way to set something so simple up? Right now I am just saying in my script:
anim.SetTrigger(sleepAnimationTriggerName);
The object is a prefab, and there are at least 15 of them in the scene at any given time.
I have tried resetting the scale when the object sleeps, by storing the transform.localescale
of the object and resetting it in the OnDisable()
method. This didn't work.
Any ideas?
Just Uncheck the checkbox Write Defaults in the Idle Animations:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With