Hairball Simulation
I've always loved dynamic rope effects in games. I've often wondered how you'd go about building something like that. A while back I decided to find out, and take a shot at implementing something. It was time to just get in there1.
Originally I was going to fall back on Chain
or HingeJoint
in the Unity Physics System. After a little searching, I came across a non-physics-engine based rope simulation technique using Vertlet Integration2 from this video.
Adding some configuration, and tweaks on top of this technique, I ended up building a weird hairball simulation. There are a bunch of "rope" objects, with "gravity" pulling them away from the mouse position, but anchored to the mouse position. The result is below. It's surprisingly satisfying to play around with, and see how the ropes react and settle. Feel free to take a look at the code.
- "Just Gotta Get In There" a concept from Butterscotch Shenanigans, https://podcastaddict.com/episode/127973453
- Vertlet Integration, https://en.wikipedia.org/wiki/Verlet_integration