Discuss Scratch

Lynxygaming714
Scratcher
4 posts

Scratch Animation

I'm currently having problems animating in scratch. I've split up a sound into parts and used the lengths to make an animation, but every time I use this method, It quickly falls out of time. How do I make a block switch costumes without spending any time at all doing so? If that's not possible, I just want to know, how long does a single block in scratch take to run?
Lynxygaming714
Scratcher
4 posts

Scratch Animation

these script i've been using work like this:
switch costume to [insert costume name]
wait (insert time) secs
NMario84
Scratcher
1000+ posts

Scratch Animation

There's always different solutions to solve an issue.
If you do not like using the wait block, you can always count the frames by recording them as a variable. If the variable gets to a certain number, switch the costume to the next one, and set the variable back to 0.

If you want the costume to keep switching without any wait time in between, use the next costume block.
next costume

You can also use this as an alternative solution.
switch costume to ((costume[number v]) + (1)
Lynxygaming714
Scratcher
4 posts

Scratch Animation

Thanks @NMario84. I do appreciate this information, when I make animations entirely on my own this will come in handy, but the project I wanted to use this for actually has the system for how costumes switch already coded in, It would be a pain to change it and ruin consistency. Also, this IS a scratch issue, because this involves animating to music, I've got the exact times according to tempo, but It lags behind, especially when lots of notes and costume changes are close together. The only way I can think to fix this is to deduct the time it takes to run the block from the wait time. Does anyone know how long it takes for 1 block to run? Also, does it change if it's a custom block? It's more something like this:
define switch costume (cos)
switch costume to [cos]

switch costume (anim)
wait (0.075) seconds
and so on. This essentially covers how these costume changing methods worked.

also, I use something similar to the alternate solution when going back a costume in my own projects, just in a custom block!

define previous costume
switch costume to ((costume [number v]) - (1))

Powered by DjangoBB