Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I Need Help To Find FPS For An Animation
- -ComX_Animations-
-
14 posts
I Need Help To Find FPS For An Animation
Hello fellow scratchers. For a school project, I need to make an animation that is 12 FPS, but I want to make the art for this in Scratch, and I also want to see what it looks like.
Like some people, instead of using the |wait () seconds| block for animations, I am using the |rest for () beats| to add time between frames. <- (That block is in the Music extension). Can someone calculate the wait for the rest block for 12 FPS
And remember, a “beat” isn't a second.
Thanks.
Like some people, instead of using the |wait () seconds| block for animations, I am using the |rest for () beats| to add time between frames. <- (That block is in the Music extension). Can someone calculate the wait for the rest block for 12 FPS
And remember, a “beat” isn't a second.
Thanks.
- awesome-llama
-
1000+ posts
I Need Help To Find FPS For An Animation
There's not enough information to calculate a number yet. The rest block is dependent on the tempo. At 60 BPM (default), a beat will be 1 second, which goes against what you said: “And remember, a “beat” isn't a second”.
Last edited by awesome-llama (Nov. 19, 2021 12:27:37)
- -ComX_Animations-
-
14 posts
I Need Help To Find FPS For An Animation
Yeah, I know. My brother tried this out . 60 BPM = 1 beat per second.
- -ComX_Animations-
-
14 posts
I Need Help To Find FPS For An Animation
And if I want 12 FPS, I need to rest in-between each frame by .05 secs.
- -ComX_Animations-
-
14 posts
I Need Help To Find FPS For An Animation
Wait a minute though… I just made 2 scripts:
When green flag clicked:
(Set tempo to (60)
(rest for (1) beats)
and:
When green flag clicked:
(Wait (1) seconds)
So they should stop working at the same time, as you can see. But they don't. The first script has ever so slightly faster than the 1 sec. one. And this could through my whole animation off when I export the frames and sound into a different software.
When green flag clicked:
(Set tempo to (60)
(rest for (1) beats)
and:
When green flag clicked:
(Wait (1) seconds)
So they should stop working at the same time, as you can see. But they don't. The first script has ever so slightly faster than the 1 sec. one. And this could through my whole animation off when I export the frames and sound into a different software.
- awesome-llama
-
1000+ posts
I Need Help To Find FPS For An Animation
I don't know why they are different. It seems like it's just because of how Scratch tries to handle the two blocks. Wait a minute though… I just made 2 scripts:
When green flag clicked:
(Set tempo to (60)
(rest for (1) beats)
and:
When green flag clicked:
(Wait (1) seconds)
So they should stop working at the same time, as you can see. But they don't. The first script has ever so slightly faster than the 1 sec. one. And this could through my whole animation off when I export the frames and sound into a different software.
—
Let's jump back to solving the issue of playing a 12 FPS animation. Scratch runs at approximately 30 FPS. There's also no way to wait fractions of a frame. This means that using any sort of wait block like what you are trying will not work for any one number - there are delays that are slightly too fast and slightly too slow.
The solution to this is to not wait a certain length of time at all - use some of the other timing blocks, specifically, these:
(days since 2000)
(timer)
Both blocks are very accurate and they will always count at the same rate, regardless of Scratch's framerate. You can synchronise your animation to the current time – simply set its current frame to the value from either of those blocks (with a slight bit of maths to take into account 12 FPS).
A basic script could look like this:
when green flag clicked
set [anim FPS v] to [12] // your animation's frame rate
reset timer
forever
switch costume to ((anim FPS) * (timer))
end
- -ComX_Animations-
-
14 posts
I Need Help To Find FPS For An Animation
Wait a minute though… I just made 2 scripts:
A basic script could look like this:when green flag clicked[/quoI
set [anim FPS v] to [12] // your animation's frame rate
reset timer
forever
switch costume to ((anim FPS) * (timer))
end
I Switched to the 1st costume and tried this code out. But it just switched from 1st costume to the last one.
- LG125
-
500+ posts
I Need Help To Find FPS For An Animation
Wait 1 divided by anim afp seconds? Wait a minute though… I just made 2 scripts:
A basic script could look like this:when green flag clicked[/quoI
set [anim FPS v] to [12] // your animation's frame rate
reset timer
forever
switch costume to ((anim FPS) * (timer))
end
I Switched to the 1st costume and tried this code out. But it just switched from 1st costume to the last one.
Idk
- T1407b
-
1 post
I Need Help To Find FPS For An Animation
So I copied this code now what do I do?
- Purin2022
-
100+ posts
I Need Help To Find FPS For An Animation
The answer to your question is complicated. Did you copied it like a text? You can't; you have to copy the blocks manually. So I copied this code now what do I do?
Another thing:
I know you want to know the answer to your question but please do not necropost.
- Necroposting is when someone posted on a topic that is inactive. (when no one posted on it for at least a month)
- Make a new topic instead please.
- Want to learn more about necroposting? Go here. (Scratch wiki)
- Discussion Forums
- » Help with Scripts
-
» I Need Help To Find FPS For An Animation