Download

Scale skeletal mesh

Hi there,
I have in place a system that spawns enemies with different attributes depending on their size. So I make them physically bigger or smaller once they spawn. All is good but when the biggest one are killed the ragdoll implodes. I thought because the capsule did not scale properly, but they look okay to me in game. Any suggestion?

Doesn’t look like an implosion.
The mesh would likely not remain as steady as it does…

Have you tested the PHAT asset of the specific model out without gravity?

The movement could be caused by a single leg (probably on the right side based on video) “jumping” to a snap when physics is turned on.

You’d see it less on smaller models, but you’d still see it.

To debug these things, turn on Slowmo at .5, enable anim debug. Record the screen, and then analyze the footage.

Ps: it looks like the mesh is suddenly upside down when ragdoll goes on?
Review the footage in slomow.

I tried your idea and it looks like it flips in an instant. Only when scaled BTW. I recreated the physic asset several time to avoid conflicts and the result are always the same: the one with the regular scale is fine the bigger ones try to collapse the limbs inside the one higher in the chain. I guess I need to find a way to scale the physics asset accordingly.
Update 1. I’ve re-imported the mesh with an higher scale factor. If I disable the animation BP the scale of the model is correct and the ragdoll works. So, now my question is: how do I scale the AnimBP/Animations… :thinking:
Update 2. Setting the “RelativeScale3D” in Details>Transform does the trick, BUT doing the same operation at runtime no.

Maybe it’s as simple as inverting the value of the proper axis?

Mind you, you could also compile the engine from source, update phys X to the latest, and possibly solve it…

Edit and compile the source is way beyond my current level. I just had to scale the relative scale to match the import settings to work. Unfortunately, I cannot do it at runtime for some reason.

Update 3. If I spawn enemies of the same size, they all work fine. But if I randomize the size they seem to behave depending of the size of the previous I killed. No idea why. Maybe something is shared between instances?

The solution was to scale the actor using the Spawn Transform Scale property of the Spawn Actor function. :sweat_smile:

1 Like

That’s how you debug stuff in unreal 90% of the time.
Keep pokin at it until you prod it enough that you can make it work :stuck_out_tongue:
Gratz.

(Any idea why it was literally upside down though?)

Hi, sorry for the late reply. My guess is that the scale was applied for the mesh but not the physical asset, so when I enabled the Set Simulate Physics the constraints and the physics bodies would try to snap into place.