How would I go about destroying certain parts of a skeleton?

hi there,

Im playing around with a prototype, and trying to get “hit zones” of a sort…so that when I would hit certain parts of the enemy mesh, it would destroy whatever it hit. So if I hit an arm, the arm would get destroyed, if it hits the leg, the leg would get destroyed…etc.

at the moment im thinking like this : I have 4 overlap detection volumes, that when they overlap with the projectile, they ping. But now I dont know how (if at all possible) to call that specific area of the body hit, to get destroyed

any ideas ??

2 Likes

I can maybe help you get started,

This requires a skeletal mesh with a properly setup physics asset.

when the hit occurs you can get the “Hit Bone Name” and use that in a switch or such to decide what is appropriate.

As a test you can just go into your physics asset and delete all of the constraints then when a bone is hit just turn on physics for it. This will cause the pieces to just fall away.

thanks very much for the response RimmyD. I will try this asap

I have tried several things in the last few days, most without any success.

Ive been playing in the anim blueprint, since its the closest I came to manipulating specific bones of the skeletal mesh.

But I cant find anything that would let me “break constraint” or “delete bone” or anything similar, which would be ideal. Only thing Ive found was transform-modify bone by name

Typing this really quickly but try this initially:

For your physics asset go into constraint mode and just delete all of the constraints. You want too keep all of your boxes/bones but remove the constraints between them. This way if a bone is told to simulate it will just fall away.

In your blueprint there is a function you can call on a skeletalMeshComponent called something like “Wake all bodies below”. For the parent just plug in the hit bone from the hit result. Your mesh will have to be simulating physics at this point as well which is just a variable on the actor.

I am away from my comp right now but can try to get more exact examples later.

awesome Rimmy, great idea. trying this now !!

File to download

Here is an example of what i was talking about. You will need to extract this to a ThirdPerson blueprint project (i use a ref to the HeroTPP skeletalmesh).

Extract it to Content and make sure its in the folder Content/BustinDude

Open the included map and click on the dude’s hands and such to break them off.

Rimmy, thanks so much for offering help like this…

I have an issue though, cant update from 4.2 until the end of the month. And when I open your level, everything is blank, and the content/BustinDude folder is empty even though the uasset files are inside.

is the version mismatch an “unworkaroundable” error in our case ?

kind regards

Argh i totally made this in 4.3 Preview without thinking. Let me quickly detail it.

I created a new physics asset from the HeroTTP mesh. In PhAT I change the Body Mode to Constraint Mode, do a CTRL+A to select all constraints then delete them by pressing the delete key.

Place the mesh into the level and override its physics asset with the one you just made.

In the Level BP:

On “Begin Play” i set the player controller’s Show Mouse Cursor property to true so i get a cursor.

Then the actual logic for clicking/breaking the dude:

In case picture doesn’t show well:

Event to trigger is “Left Mouse Button” release output.

Get Hit Result Under Cursor By Channel (Target is player controller)

Break the hit result and cast the Hit Actor to a skeletal mesh.

Use the skeletal mesh output to Set All Bodies Below Simulate Physics(Plug in your bone name from the Break Hit Result “Hit Bone Name”.)

Then do a Set All Bodies Below Physics Blend Weight (Target is cast result from above, also plug in bone name again). Set the Physics Blend Weight to 1.

1 Like

Rimmy, thanks so much !!! Works like a charm

the set all bodies below simulate physics is incredibly misleading to me. What I get from the name is that all bodies below the bone name (but not it) we input simulates physics. Which is not whats going on here

I agree it is slightly misleading :). In fact I assumed the same thing and was originally using the bone name to get the parent bone and calling the “Set All Bodies Below” on the parent which of course did not work so well :stuck_out_tongue:

Rimmy, I have fiddled around from the base you provided, and added a fps component that you can shoot at the mesh and the projectile tears off the limbs.

Theres something weird going on with the torn limbs though, they get weirdly stretched out into infinity…I suspect there is something wrong with the setup of the mesh or the fact that it gets hit by a projectile which in turn adds radial impulse at hit location.

check the screen for what im talking about.

So this is because as a quick test version we deleted ALL of the constraints. This is mostly okay as almost all of the parts of the skeletal mesh are all bound to a single bone. The torso (and maybe some other part) has no such luck though. The torso is bound to multiple bones who no longer have a constraint to one another so when they go flying off in different directions they stretch the mesh all over.

For a quick fix you could reset the physics asset and only delete the constraints that work well like this. Leave the torso’s joints constrained so it will fall off nicely.

Your final meshes will need some logic to know which bones to actually allow detaching based on the character type. A fully organic creature with all welded verts will not handle this approach well. You would need to have your binding and vert welding set up to properly allow parts to tear off. Something like a robot would usually be simple to do this way but if you want to bloodily tear off a humanoids arm you may have some issues to deal with.

Hmm, could be a number of issues. Usually the character mesh has collision disabled so that the collision component can handle that.

You may need to look into what channels the skeletal mesh itself has enabled for collision. I will look into this when i get back to my comp.

Rimmy,thanks so much. Your advice prooved to be invaluable yet again. I fixed say 90% of the problem with welding alone.

But now I have another issue :slight_smile: Blueprinting a character type based on this mesh and its physics asset (with generic anim state machine from third person example) is currently just bouncing off projectiles no matter what I try to do.

is there anything I should set in the anim blueprint for this ? I may very well be going mad already from unreal.

is that a good thing ??

anyway, much obliged !

I have separated the collision capsule from the mesh so that the mesh is surely isolated from any other potential collision events.

Its weird because everything else is exactly the same as in our initial case, where the mesh itself was placed on the level with no blueprint.

I come from the FUTURE its 2022 and here in the topic you can find the best working answer for how to do limbic dismemberment in Unreal 4 or 5 , even if its done in 4.3 here.
Ive looked some tutorials on utube but these are mostly very complicated and will negatively affect the performance of your project .