Discuss Scratch

Syix
Scratcher
100+ posts

How can I make this less laggier?

I made a project, but it's going really slow. The frames don't correspond to the music. How can I fix this lag, and what's really causing it. Because 200 costumes seems fine ngl.

https://scratch.mit.edu/projects/561044008/

Last edited by Syix (Aug. 16, 2021 18:17:39)

ScolderCreations
Scratcher
1000+ posts

How can I make this less laggier?

Are there any loops that repeat for a long time inside a run without screen refresh block?
Syix
Scratcher
100+ posts

How can I make this less laggier?

ScolderCreations wrote:

Are there any loops that repeat for a long time inside a run without screen refresh block?
No, just normal code, no custom blocks.

Last edited by Syix (Aug. 16, 2021 18:22:49)

Flowermanvista
Scratcher
1000+ posts

How can I make this less laggier?

It plays back fine on my computer - your computer just might not be up to the task. This is why I recommend never using a simple forever loop to play back “video” in a Scratch project - because if the playback is not perfect, it will go out of sync with the audio. Instead, I recommend you use something like this (if nothing else in your project is using the timer):
show //or whatever else you want to happen before playback
start sound [sound v] :: sound
reset timer
repeat until <(timer) > [10.0]> //<-- Put length of video (in seconds) here.
switch costume to ([ceiling v] of (((timer) + (0.0001)) * (10))) //<-- Put framerate of your imported gif here.
end
hide //or whatever else you want to happen at the end of playback
Once you set the framerate correctly, this script will never go out of sync unless the lag is somehow so severe that the sound starts to lag or stutter - which I can't recall ever happening to me in Scratch 3.0.

Last edited by Flowermanvista (Aug. 16, 2021 18:43:57)

Syix
Scratcher
100+ posts

How can I make this less laggier?

Thank you for the answer, weirdly it glitches out the project going to random frames.. Never mind, I did something wrong, it works perfect now.

Last edited by Syix (Aug. 16, 2021 18:59:31)

Syix
Scratcher
100+ posts

How can I make this less laggier?

Much better, thank you so much!

DangerousDawn
Scratcher
1000+ posts

How can I make this less laggier?

I'll report as resolved.
Syix
Scratcher
100+ posts

How can I make this less laggier?

DawnRooney27 wrote:

I'll report as resolved.
I recommend not to do that, I may still have questions and I will have to make a new topic if I do. Probably best to recycle topics.

Last edited by Syix (Aug. 16, 2021 19:28:55)

DangerousDawn
Scratcher
1000+ posts

How can I make this less laggier?

Syix wrote:

DawnRooney27 wrote:

I'll report as resolved.
I recommend not to do that, I may still have questions and I will have to make a new topic if I do. Probably best to recycle topics.
Actually, that's not allowed. You need to use another topic for each question.
Syix
Scratcher
100+ posts

How can I make this less laggier?

For the same topic it's not allowed?
Paddle2See
Scratch Team
1000+ posts

How can I make this less laggier?

Syix wrote:

For the same topic it's not allowed?
Sure, if you have further questions about the same issue, this would be the place for them. I'll leave it open for now.

Powered by DjangoBB