Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2D Animation, varibales shall not change

Discussion in 'Animation' started by Tyraxx, Jul 30, 2014.

  1. Tyraxx

    Tyraxx

    Joined:
    Jul 30, 2014
    Posts:
    13
    Hi everybody,

    just wanted to improve my 2D-Walking-Animation, since in some frames the sprite's feets are not on the ground but in air. I could go to the sprite editor and adjust the pivots, but then I thought, why not just adjust the y-pos in the animation.

    Unfotunately, when I change the value on one animation-frame, it starts to smooth the values from one frame to another.

    E.g.
    Frame 1 (y=2,5) and frame 4 (y=2,0).
    The animation then starts to approach the 2,0 value by changing the value closer each frame, but I want it to stay. I.e. frame 1-3 (y=2,5) and frame 4 (y=2.0).

    Is there any way to turn off the smooth, without putting a keyframe in all "empty" frames?

    PS: I dunno if their called frames, I just call'em frames for now.
    OT: BTW, how come the arrows for adjusting the position are not shown on one game object of mine?
     
  2. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    Haven't done 2D animation before, so I'm not sure if you're using the same Animation view.

    If you want to make the curve value not to interpolate but "snap" to the target value, you could try the "Constant" option.

    Be noted that, if your animation sample rate is low, you might see jitter if the frame time falls into the gap of the "snap" frame.

    upload_2014-8-3_16-24-51.png

    upload_2014-8-3_16-27-28.png