Spreading fluids, something like minecraft water physics

Hello, i have been working on fluids system, something like minecraft water physics, but i don’t know how to make it spread and disappear after its source block is destroyed or moved.
Can someone help me?

One idea is raycasting every frame, or how long the interval is in minecraft. Raycast all acround the block to see what block we can get to. Then just do some funny haha to make it spread to that part

i was also thinking about that but problem is how to find out when is souce block gone

Having a repeat until loop and then destroy the water afterwards, possibly?

So, assuming that 1 block in your game is 1x1x1. We can just raycast by 1 stud to check if there’s anything there. If there is, there’s a block in the way. If there isn’t, its air and we can move there. Don’t… do this for positive y, or else your water will just fly.

probably… but how do i make parts of it disappear after it has been brigged

i know, but anyway, thank you for advice

Maybe a table could list each part, or square of water and a for loop could go through them and destroy them.

probably, thank you for idea, i will write it down

1 Like

You also need a way to index it. So give it a value or name, and index it using that. Find that part in workspace or smth, and destroy it while removing it from the table.

1 Like

thank you all, now i have idea how to do it, i may ask for some ideas, but i think i got idea how to do it, have good day

1 Like