Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Temporarily make fluids in a container ignore other colliders/fluids
#1
Hello,

I'm new to ObiFluid and I'm currently working on a 2D bartender game where you can grab glasses with fluid, move them around and pour the fluids into other glasses (or onto the shelves).

For example, I'd like this to work:
  • Drag and drop the red fluid glass from below through the upper shelf collider and through the blue and green glasses without affecting the liquids at all - it should just pass through it.
  • Rotate the red fluid glass so the red fluid pours out. Once the red fluid has left its glass it should be stopped by any other glass (i.e. fill those glasses and mix with any fluids inside) or the shelf.

So, in short, I'd need a *grabbed glass with liquid* ignore all non-grabbed-glass colliders/liquids, and *liquid that has left a grabbed glass* to normally interact with the world.

Liquids can mix, so I don't think I could do anything like "liquid from the red emitter behaves differently" - it might be glass mixed with red and blue liquid that is grabbed, while other glasses also already have red or blue liquid.

I see two ways this could happen:
  • If I make the simulation 3D with very flat models, it would still look 2D in an orthographic camera and I could use the Z-axis to make a grabbed glass and its contents ignore any other collider. When the fluid leaves the grabbed glass trigger volume because it is poured I could adjust the Z-position of those now-outside-the-glass fluid particles back to the Z-position that everything non-grabbed is on.
  • If there is a way to have multiple simulations and to transfer colliders/fluids between simulations, I could temporary make a grabbed glass and its fluid a separate "grabbed glass" simulation and return any fluid that leaves the grabbed glass to the "main" simulation.

Do those ways sound possible? Is there any other (maybe better?) way to achieve this?


Attached Files
.png   Unity_2024-06-21 16.16.06.023.png (Size: 2.12 KB / Downloads: 18)
Reply


Messages In This Thread
Temporarily make fluids in a container ignore other colliders/fluids - by Tobias - 21-06-2024, 03:31 PM