How to set mass of shape component?

My game has a pawn that gets a lot of custom forces applied to it. Up until now, its root component was a UStaticMeshComponent and forces were applied to that. We could set the mass of the UStaticMeshComponent by calling SetMassOverrideInKg in BeginPlay. We’ve gotten to the point where we want to add animations to the mesh, so we’ve swapped out the UStaticMeshComponent with a USkeletalMeshComponent and replaced the root component with a UBoxComponent. But the mass of the UBoxComponent seems locked at 1 Kg. Neither SetMassOverrideInKg nor SetMassScale nor the mass checkbox in the editor work to change the mass. Is this a bug or is there something else that has to be done to change the mass of a shape component?

Best way is to set invisible sphere mesh component that has mass, simulates physics and has collision.

Then you set visible component on top of that physics one. This component can have collision (for projectiles or some event triggers), but no physics simulated.

However if you want ragdoll for skeletal mesh, you should watch some tutorials about it.

So there’s no way to use a shape component? You have to use a mesh?

No there is way to add physics to skeletal mesh: search for “Ragdoll in unreal” there are plenty of tutorials.

Or get Advanced Locomotion System from marketplace, play with it, see how ragdoll works, and what it really is before you spend month learning it and then developing it for your project.

For static meshes, problem is if you use them is that if you change dimensions or want to slightly move mesh, really anything, it will affect physics. So it is easier to make invisible ball or capsule that simulates physics, then put your visible mesh on top of it. Less hassle if you want alter mesh.

I was doing prototype of 3d space combat with inertia based and physics simulated spaceships, and it was really easier to have every spaceship as ball, and then just swap visuals on top of that invisible ball.

I think your “bug” is because you can only have single mesh that is physics simulated in component hierarchy (unless you use physics constraints or let them move separately).

Ps. pic of components hierarchy with ones using physics could help here.

So it is easier to make invisible ball or capsule that simulates physics, then put your visible mesh on top of it

Yeah that’s what I’m trying to do, but I can’t set the mass of the invisible box

It needs to be static mesh, that you make invisible in game.