Discuss Scratch

-ComX_Animations-
New Scratcher
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.
awesome-llama
Scratcher
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-
New Scratcher
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-
New Scratcher
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-
New Scratcher
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.
awesome-llama
Scratcher
1000+ posts

I Need Help To Find FPS For An Animation

-ComX_Animations- wrote:

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.
I don't know why they are different. It seems like it's just because of how Scratch tries to handle the two blocks.



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:

dayssince2000timer

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:

whenclickedsetanim FPSto12 your animation's frame rateresettimerforeverswitchcostumetoanimFPS*timer
-ComX_Animations-
New Scratcher
14 posts

I Need Help To Find FPS For An Animation

awesome-llama wrote:

-ComX_Animations- wrote:

Wait a minute though… I just made 2 scripts:


A basic script could look like this:

whenclickedsetanim FPSto12 your animation's frame rateresettimerforeverswitchcostumetoanimFPS*timer
[/quoI

I Switched to the 1st costume and tried this code out. But it just switched from 1st costume to the last one.
LG125
Scratcher
500+ posts

I Need Help To Find FPS For An Animation

-ComX_Animations- wrote:

awesome-llama wrote:

-ComX_Animations- wrote:

Wait a minute though… I just made 2 scripts:


A basic script could look like this:

whenclickedsetanim FPSto12 your animation's frame rateresettimerforeverswitchcostumetoanimFPS*timer
[/quoI

I Switched to the 1st costume and tried this code out. But it just switched from 1st costume to the last one.
Wait 1 divided by anim afp seconds?

Idk
T1407b
Scratcher
1 post

I Need Help To Find FPS For An Animation

So I copied this code now what do I do?
Purin2022
Scratcher
100+ posts

I Need Help To Find FPS For An Animation

T1407b wrote:

So I copied this code now what do I do?
The answer to your question is complicated. Did you copied it like a text? You can't; you have to copy the blocks manually.

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)

Powered by DjangoBB