Search Unity

enabling/disabling GameObject with animation inconsistent in 2018.3.0f2

Discussion in 'Animation' started by digikatie_, Dec 28, 2018.

  1. digikatie_

    digikatie_

    Joined:
    Jul 23, 2012
    Posts:
    3
    I believe I've found a bug with animations introduced somewhere around unity 2018.3

    I've been animating quite a bit and sometimes, depending on the need, I'll enable/ disable game objects using an animation vs going the sprite sheet route. I'm now noticing different behavior in the animation timeline when enabling/ disabling game objects. Thru unity 2017 I was not seeing this behavior:

    1) GameObject enables itself without a keyframe directing it to do so.
    See annotated video here:
    https://www.dropbox.com/s/zruywa5nuwc3c2t/animation_EnableDisableBug.mp4?dl=0

    Problem: If I create an animation that starts off with the game object disabled on frame 1, then in 30 frames enables it, its ignored. The game object enables itself immediately on the the 2nd frame. HOWEVER... if I start with the game object enabled, it will keep the object enabled until it reaches the keyframe that disables it.

    Expected Behavior: when using an animation to control enabling/ disabling, the game object should not enable unless there is a keyframe directing it to do so.

    2) Keyframes are "blurring" together.
    See annotated video here:
    https://www.dropbox.com/s/jpo0v84wgnsditv/animation_BlurredKeyframes.mp4?dl=0

    Problem: When I have back-to-back keyframes enabling/ disabling different game objects on each frame, when the animation is played it looks like unity is trying to blur my frames together. Notice how each frame appears to have multiple objects enabled? I didn't tell it to do that!

    Expected Behavior: the animation should play each keyframe individually without trying to "blur" them together.


    Is there a new setting I missed somewhere
     
    Last edited: Dec 28, 2018
    DezBoyle likes this.
  2. GoodMath

    GoodMath

    Joined:
    Sep 23, 2019
    Posts:
    3
    To get around 1 you can just place another keyframe in the middle of the animation set to disabled to make it constant disabled between the two keyframes until it transitions into the third enabled keyframe. Although this is strange, it's relatively simple to understand as you just remove the transitioning altogether and think of anything above 1% enabled to be enabled. To get around 2 you probably cant control the blurring without very precise keyframes so instead use a script in a parent game object to enable the child so that it doesn't affect the animation or the script, just the visuals of the object.

    I agree these are bugs, but they don't make or break a mechanic as there are workarounds.