However , in my game I’m trying to place the liquid in a moving container in which i want this liquid to respond properly with physics of the moving container.
The major problem I’m facing is that when the container moves fast , the liquid starts to penetrate or spill outside the container , although i have set the proper colliders and rigid bodies.
I’m not sure why this is occurring in the first place , but i have tried to change some properties of the rigid bodies but with no use (for example making the collision detection continuous instead of discrete).
Well, it’s not the asset itself. When you move rapidly a gameobject its rigidbody2d should have collision detection mode continuos in order to ensure all collision posibilities between frames. If not, gameobject could teleport though colliders without triggering nothing.
1st of all, go to Water2D/Prefab/WaterDrop (OilDrop if youre using oil) or to your custom Metaball Particle if you created another material. On the prefab rigidbody, change collision detection to continuous. Remember this will make a performance drop, since it needs more cycles.
Next, your platform kinematic rigidbody should also have collsion detection mode continuos. In game you should never change your transform.position value. Instead of it, use rigidbody2D.MovePosition() at fixedUpdate.
Finally, remember the error will persist if you move your plattform directly through inspector, like at the video… since it still moves your transform.position, but it will work during game.
Hi. Its quite late to reply. Maybe someone else will found it useful.
Try to change the Rigidbodies setting like Collision Detection from discrete to continuous.
Moreover, try changing interpolation from none to extrapolate or interpolate.
Hopefully It will help.