Is it possible to create a destructible skeletal mesh?

Is it possible to create a destructible mesh from a skeletal mesh? Would it still be possible to control the destructible as a pawn? If not, is it possible to programmatically detach joints? What is the recommended way of creating a breakable pawn from a skeletal mesh?

I have a very primitive vehicle that I would like to break into its component pieces upon collision or some other event. However, I’m struggling to create a destructible mesh from my skeletal mesh; the option appears to be available only for static meshes. I would be happy just detaching the bones from one another so the parts flew every which way.

In Unity, I was actually constructing the vehicle out of several imported meshes and then enabling their respective rigid body properties upon impact. I tried a similar approach in UE4 but the results weren’t great. I could definitely be doing something very wrong related to nested primitive component physics, but that also made me think that there’s probably a better way to achieve this behavior. Any ideas or insights would be appreciated. Thanks!

5221-vehicle.png

5222-vehicle+skeleton.png

Destructible skeletal mesh is not currently supported. However, you can create a physical asset using several rigid bodies that are constrained together. You can make the constraints breakable using a force threshold which sounds like it could work for this situation.

I didn’t realize you were actually using WheeledVehicleMovementComponent.

We are actually doing a lot of work on this class right now and you should see some improvements in the upcoming release. The problem you’re running into is
related to the fact that vehicles currently treat the physics asset as a single body entity. This means that ragdoll features like breakable joints will not work.

However, full support for multi body vehicle is now in the engine and should be out in the upcoming release. With this change you should be able to use breakable joints. This change is already in github, but it hasn’t really been tested yet so I wouldn’t recommend it right now.

I would recommend waiting for 4.2 as there should be a lot of vehicle fixes.

Thanks Ori, this definitely seems like the right path for what I’m trying to accomplish.

I haven’t been able to get it quite right yet. I was able to get the physics asset to perform correctly in the simulation. When I drag the corresponding mesh into the scene and drop it, the car breaks apart nicely. However, I can’t cause the joints to break when using it within the vehicle blueprint. I dug around the WheeledVehicleMovementComponent and WheeledVehicle classes a bit to see if I could determine where the override is happening (if at all), but I haven’t figured it out yet.

I also tried accessing the constraints directly through the vehicle’s mesh to see if I could programmatically break the bones, but the closest I could get was the socket transform. I’m about to give it a go with C++ to see if I can get closer.

Here’s an 18s video of my setup and current issue: - YouTube. You can see the isolated mesh falling out of the sky and breaking to the left at 0:12.

Thanks!

Cool, I’ve been stalking those commits on master in the name of learning. I’ve got plenty do while I wait. Thanks again!

Is it a bad idea to change the physics asset at runtime? I found that using a pair of physics assets (one sturdy and the other brittle) and swapping them according to gameplay events gives me the behavior I want.

I looked through some of the ConstraintInstance/PxD6Joint code and also saw that the SkeletalMeshComponentPhysicsAsset implements BreakConstraint(), but I haven’t tried hooking it up yet (nor do I know if that’s possible). Is the latter the recommended approach?

This is a good way to do it. This is similar to how we would use a capsule when a character is walking around, and then switch to a ragdoll when the character dies.

Some caution is needed though:
The vehicle movement component uses the original physics asset when it creates the vehicle simulation data. Once you spawn the brittle car it’s probably a good idea to remove the vehicle component.

Hope that helps

That definitely helps. Thanks!

I have not tried, but what if you create a squeletal mesh with only the bones and attach static mesh to them, after your model is even hard