Download

simultate water with an array of cubes

Hi all,

say i wanna create a 10 x 10 array of cubes to simulate water physics : this array is on the (0,x,y) plane (the ground) and if i throw an obect on it, i want it to behave like water.

Is there in UE4 a built-in “physics constraint nodes system” (like in World of goo) ? (i dont know how to call it)

Yes, you can add a constraint on each body (actor) and turn on "simulate physics;) you can also add joints between each object.
Typically, what you’d want to do is set the cubes to be fixed in the X/Y movement direction, and X/Y/Z rotation axes (only move up/down.)
Then link each cube to its neighbors with a soft distance constraint joint (spring.)
To build a web of 10x10 you’d have to add 81 joints, though. That’s a lot of work :slight_smile:

Thanks jwatte

Alternatively, you could just create an actor that spawns static mesh components, and write the physics yourself. Have an array of +/- offsets from “sea level”, convert to a spring force with Hooke’s law, add any external forces for that tick (including a damping force maybe), simulate, write back to the static mesh components. 100 elements should be easily done single-threaded.

Hi ScottMichaud, your advice seems better in term of flexibility and vey probably in term of performance. Thank you so much