07-05-2024, 12:01 PM
(07-05-2024, 08:45 AM)spikebor Wrote: But still need some custom coding in some area, for example, an airplane will not just sink if it is rotated side way in Tears of the Kingdom, it will rotate about to either face up / face down for the player to have a better area to stand on when player crashed the airplane into water, not realistic physics but a quality of life for the player.
This can be done using collision callbacks, or even just regular Unity triggers in case your fluid is supposed to be confined in a specific area like a pool: whenever an object is inside the fluid area, rotate it upright. This behavior not physically based, so you can skip physics entirely: specific forces applied by individual fluid particles don't really matter.
(07-05-2024, 08:45 AM)spikebor Wrote: Currently my pool with particle size 0.34, with mass =2kg. It cannot add enough buoyancy force to pull the orange plate (20kg) up when it sank. But when it on the surface of water, it does not sink.
I then try with a massive mass=20kg each particle, now I can see the buoyancy force more clearly when I drag it down, it will be violently pulled up and jump up the air. But when I drag it all the way down to the bottom of the pool, it just lay there. Is this the expect behavior?
A plate vs large enough particles means simple mechanical forces will have a non-negligible effect on buoyancy: the plate can become "stuck" due to its shape, not allowing denser particles to move past it towards the bottom of the pool because it acts kinda like a shield/net that captures particles as they move down.
Using smaller particles, or rounding the edges of the plank collider (you can do this automatically by increasing the collider "thickness" slightly) to facilitate particles sliding past its edges and towards the bottom will improve behavior.