Download

How to implement cuttable Bodyparts

Hey UE4 Community,
Im currently trying to get a more lengthy (Boss-) Battle implemented.
The Player should be able to Cut/Destroy specific Body parts like his Tail or Arms. The Animations doesn’t need to change with that.*

So my Question would be: How do I best implement this? I firstly need a way to recognise which party is attacked (im guessing collision boxes attached to bones?). And secondly I need to remove a Part of the Mesh (on a specific Bone). Bonus points if the removed part would actually fall to the ground and stay there.

Any Help would be greatly appreciated.

Thanks,
Ara

(* So no Leg cutting that he stumbles over and just crawles, etc)

First of all, welcome to the forums.

So here are the basics:

UDK had a nifty feature to break body parts based on the PhysicsAsset (I even wrote a tutorial for it) but this functionality is probably not in UE4

as for Horus’ 2nd point, actually the body parts should be animated with the mesh and not just attached to a socket (otherwise they would move as attachments but wouldn’t animation on their own)

Sorry Chosker but unfortunately I cannot help you further as I have not explored characters at all

I think Chosker doesn’t mind, since I’m the one who asked Question :D.

At least for a tail I could do the a seperate mesh attached to the Body.
But for Arms I need to directly manipulate the Skeletal Mesh.

There is a “Additional Body Parts” section in the Skeletal Mesh Editor, but I haven’t found out, what excactly it’s used for. Hopefully i can somehow use it and if that is a dead end i guess i’ll have to take a long look into the destructible Mesh C++ Class.

To remove the part I think you can do something simple like Mesh->HideBoneByName(“tail”, EPhysBodyOp::PBO_Disable). Optionally, you could just scale the bone/mesh down like you would see in a character customizer. You then attach a wound mesh and spawn a dummy tail in the world.

I do mind actually. I did this for UDK and I will want to do it for UE4, in a somewhat distante future :slight_smile:

Hiding the bone would just make it have a scale of 0. cutting an arm would make it disappear, not actually see it fall to the ground.

using additional body parts could be a way, but this should also be doable by doing it in the same mesh (if the mesh parts are ready to be broken).
in fact the method in UDK might work all the same in UE4. we need a function that breaks a physics constraint from the Physics Asset (which probably exists), and then the toolset to import alternate vertex weights and the code to swap them (probably not implemented into UE4, but who knows)

google “Bonebreak dismemberment UDK” and you’ll find my tutorial. at least should give you a good grasp of how it was done in UDK and what requirements were needed back then. I’m quite sure that unless something huge is implemented (like the cutting in MGS: Revengeance or the chopping in Left4Dead2 - which I doubt) this method and its requirements will probably still be relevant

that seems like a really simple and effective way to do this, ill have to try that out. thanks!

sweet. Thank for the Tut. Ill report back when i have some results.

well I think you’ll lack the whole ‘alternate vertex weights’ part from it from the toolset, but looking forward to hearing your results :slight_smile: