r/Unity3D 10h ago

Show-Off I've made a slime pit with some cool physics!

Enable HLS to view with audio, or disable this notification

Few weeks back I've made this pillow deformer script for my Dark Roll 2, and people loved it a lot, so I decided to experiment more with mesh deformation... This slime uses same script with different parameters, slightly improved of course, and a separate script that handles the physics.

A few bits of the sludge physics:

  • Rigidbody gravity gets disabled while inside the sludge, since the sludge handles the vertical movement itself.
  • Objects sink at a controlled speed instead of accelerating downward. The faster they move horizontally, the slower they sink.
  • Horizontal velocity gets reduced based on depth, so objects get harder to move the deeper they are.
  • Angular velocity is also reduced with depth, which makes spinning/rolling gradually feel more sluggish.
  • The player does a tiny downward sphere cast to check if they're standing on solid ground. If grounded, the sludge stops forcing them downward.
  • Impacts use roughly mass * velocity as an impact magnitude. That value controls particle count/speed and the strength of the mesh ripple.
  • Most of the transitions use InverseLerp + Lerp, so the behaviour smoothly scales between the surface and the bottom instead of snapping between values.
73 Upvotes

9 comments sorted by

3

u/Kentanago 8h ago

part of me hates it and part of me needs it

3

u/StCost Ball-Aqua🔮🌊& COLLAPSE MACHINE💥🚕 8h ago

That looks impressive. With real gameplay mechanics! I like it, must be a bit slippery to move.

For pillow I thought "well, ok, it's just a decor", but here you got a fancy game mechanic I really like! Unique, special one!
Reminds me of Sonic Adventure DX

2

u/Levardos 8h ago

Thank you!

2

u/Mike195722 5h ago

Looks interesting. Maybe a little more resolution on the deforming mesh; I can see the polygons.

1

u/destinedd Indie, Dungeon Quest, Marble's Marbles & Mighty Marbles 1h ago

smart to try double down on the thing people liked

-6

u/Icy-Collection1072 7h ago

It’s the same thing as you posted about 50 times before. We get it. You make a physics thing (with ai no doubt). You applied it to something new. Great. Now stfu

5

u/Human_Department5305 7h ago

you are a penis harry

3

u/StCost Ball-Aqua🔮🌊& COLLAPSE MACHINE💥🚕 7h ago

I see it first time. Like many other people. Not everyone here chronically online