Discuss Scratch

MrBucket-Youtube
Scratcher
79 posts

Wanting to make a fluid sim but...

Ok so heres the project https://scratch.mit.edu/projects/647056719/
whats happening is its drawing everything fine, but its lagging so much, and i have no other idea how to do it. please help me!
mistafl00py
Scratcher
51 posts

Wanting to make a fluid sim but...

Is the “forever” block inside of your Fluid myBlock necessary? I removed it, and the drawing seems to work the same. The lag seems to be coming from the pen constantly drawing and erasing the water over and over.
Grizzly_NightStalker
Scratcher
92 posts

Wanting to make a fluid sim but...

Yeah, I also took out the forever loop from your Fluid Custom Block and it stopped lagging and kept working!
Spentine
Scratcher
1000+ posts

Wanting to make a fluid sim but...

Remember that the
set pen size to ()
block exists.

Also learn about optimization, that's useful too.
MrBucket-Youtube
Scratcher
79 posts

Wanting to make a fluid sim but...

mistafl00py wrote:

Is the “forever” block inside of your Fluid myBlock necessary? I removed it, and the drawing seems to work the same. The lag seems to be coming from the pen constantly drawing and erasing the water over and over.
What i need to do is constantly draw a new one so i can add water effects. thats why i had the forever loop
mistafl00py
Scratcher
51 posts

Wanting to make a fluid sim but...

I assume you're wanting to make the water bob up and down, like waves? You could look for a more efficient solution, such as erasing top layers and adding top layers, so that you're redrawing a much smaller chunk every tick, or just using a larger pen size in general to reduce how much you redraw.
MrBucket-Youtube
Scratcher
79 posts

Wanting to make a fluid sim but...

oh ok.

Powered by DjangoBB