- Home /
How can I create a destructible soft body mesh?
I'm working on a 2d game where I need a soft body mesh, somewhat like the jelly sprites on the asset store. It needs to wiggle around and be stretchy like the floor in "The Floor is Jelly." They need to be "sliced" open, have holes cut out of it. Basically, the position of its vertices need to form around the edges of the "cut" like making an incision. I've tried Sprite Slicer from the asset store, but it doesn't have quite the effect I need. The destruction needs to be more like that of the terrain from the game "Worms, Armageddon." My scripting skills are getting there, I was just hoping someone might be able to point me in the right direction.
Answer by FortisVenaliter · May 18, 2015 at 06:30 PM
That is an incredibly difficult and complicated task. I've been coding for ten years and I'd have to sit down for a day and plan it, then spend months getting it right.
You're basically going to need to use dynamic meshes. You'll have to create a starter mesh from code, then apply the cuts and animation manually to the vertex and index data. By my best guess, you'll have to do something like a custom per-vertex physics model with tension data between them, and probably with invisible vertices in the middle to hold it up some shape without collapsing, but how the cutting would play into that I have no idea.
Good luck; it's ambitious.
Thanks for the input. I have a better direction for research now. I knew it was going to be difficult, but now I have a better idea of how! Do you know of any good material that might help me learn about advanced mesh program$$anonymous$$g a little faster?
No, but if you've never done procedural meshes, a good place to start would be generating simple primitives. Cubes, spheres, cylinders, etc. Once you're able to reliably create them with just code, you should have a much better idea on how to create the designs you want.
Answer by Eno-Khaon · May 26, 2015 at 04:00 AM
I would recommend starting here to get an idea of how to approach this. It's a pretty great introduction to 2-D fluid motion, which you could apply to a hard surface instead.
Your answer
Follow this Question
Related Questions
Set the position of a softbody? 0 Answers
Dynamic texture is visible in editor but pink when is built 1 Answer
culling issues on dynamically generated mesh 1 Answer
dynamic mesh keeps disappearing 2 Answers
Dynamic Mesh - Multiple Meshes 0 Answers