[Solved] Changing Sample in Animation Window causes blank frame?

Hi,

I’m following along the video, and added all the animations from the sprites using the assets provided from the class. After creating the animations, I changed all the samples to 30 like the video, but this causes the walking animation to have blank frames and the lizard has a weird jerky walk.

I’m wondering if this is because the walking sprite sheet only has 16 sprites and so when I set the same to 30, there are 14 blank sprits added to the end of the animation.

If I keep the samples to 16 for walking, then there doesn’t seem to be a problem, but then I’m not sure how to change the speed of the animation. In the video we changed the number of samples to speed up the animation.

I’m also using Unity 5. I’m not sure if the problem is with that, but overall I’m having some weirdness happen. Did anyone else come across something similar?

Actually, now even with the samples set to 16 it’s still hanging.
(After a 2~3 steps, the lizard stops walking and is frozen)

Is it possible my system is just buggy?

Hi, another update.

So when I first create an animation, this is what the screen looks like.

The animation ends around roughly 0.15 seconds, and when looped the lizard walks naturally.

When I change the Samples from 60 to 30, this happens.

There’s a bunch of blank frames added, so when the walking animation is looped, it walks for a little, then hangs, then starts over again.

I can’t seem to figure out how to change the Samples figure without adding the blank frames at the end, nor can I figure out how to remove the frames once they’ve been added.

Can anyone help?

Thanks!

OK, I figured out that I can right-click at the point where I want the animation to end, select "“Add key”, then the animation is reset so it ends there.

Not sure I fully understand what’s going on, but it worked for me.

Hope this helps anyone else who happens to experience similar problems!.

1 Like

The Unity timeline has a “particular” scale: between every second (0:00-1:00, 1:00-2:00, etc.) it shows you the frame numbers, so they’re not decimals of seconds.

For example, if you have 16 animation frames and set the samples to 30 (i.e. 30 frames per second), you’ll get this:

you can clearly see that the last frame, the 16th, is at 00:15 in the timeline, which is correct since the first one is at 0:00.

Now look what happens if you switch to 60 samples:

All the frames are still running from 0:00 to 0:15, but now the 1:00 mark has been shifted at the 60th frame (and the red line, which remained at 0.5 seconds, is now on the 31th frame, or 0:30).

So, the number before the : represents whole seconds, whereas the number after the : represents frames.

Hope this helps to understand the timeline.

1 Like

Thanks for the explanation. Still don’t understand why Unity automatically adds the extra blank frames, but this helps me understand what’s going on a bit better.

Thanks a lot!

Because you’re switching from 30 to 60 samples, which by definition are the number of frames inside a second, so you go from 30 frames in a second to 60 frames in a second.

Privacy & Terms