- Home /
2D Fluid inside Container mechanics
I'm having trouble maintaining fluid stability inside a container.
For example , I'm using this asset to simulate fluid mechanics : https://assetstore.unity.com/packages/tools/particles-effects/water-2d-136297
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).
This is the video where I'm displaying the issue : https://drive.google.com/file/d/1m_Bxio0ioCEOmZ2qlxlYXTCS3SifxraX/view?usp=sharing
A free fall example : https://drive.google.com/file/d/1d3-ZsN1InARYFECBjy8MLgmDLv1_sgxN/view?usp=sharing
How would I enhance this ?
Answer by xxmariofer · Nov 17, 2020 at 01:17 PM
move the object using the physics system, not the transform itself like you do in the video
Even if i use gravity for the container and leave it to drop normally on a plane, the liquid still spills. @xxmariofer
could you upload the video with that behaviour? also, fix the errors in case they are affecting the behaviour of the app
I have modified the post to demonstrate a video of a free fall , and regarding the errors appearing , they are not related to this scene . @xxmariofer
Your answer
Follow this Question
Related Questions
Is there a "fluffy" or "squishy" 2D collider? 2 Answers
how to make line renderer have a collider (2d) 1 Answer
Calculate the normal of a collider 1 Answer
2D Water rise 0 Answers