My character gets deformed when I enable ragdoll, ONLY when i try to change its scale

Hey, I feel like I’m doing something wrong, but I can’t for the life of me understand what it is…

So please help.
Here’s the context:

I’m making a tactics game (The likes of FE), but when my units go into combat, I want them to shrink, and grow when combat is over. (That’s just the style of the game)

So the problem is… When the units die, I want them to ragdoll, however for some reason they get deformed only when they are re-scaled.

In this short video, you’ll see exactly how the problem looks like, and how I produced it.

So… What I learned is that for some reason the “Capsule” of the character doesn’t get re-scaled, even though the numbers to the side clearly show that its scale has changed, but it’s not applied for some reason…

Additionally, even when I have used another character that doesn’t have a capsule, and did the exact same thing, the same exact problem happened.

If you look here, when I resize the character while in the editor, or during runtime, everything gets re-scaled as intended.

What I want to do is find a way to also apply the re-scale to the capsule component using code during runtime.
Or generally get some help to finally allow my character to shink/grow and ragdoll normally. (Whatever that solution may be.)


I’ve searched about this, and I can only find 1 post about this, but it wasn’t helpful or I didn’t understand it.

PS: This uses the Default UE5 Skeleton.
I can provide more info if needed.

Hey @2010wolf!

So the set actor scale 3D node specifically scales the root of something, which propogates down to all children. I’m going to guess that the issue lies in your BP_Base_Unit. What looks like is happening is some strange thing where the skeleton’s bone scale values are all set to 5, or possibly even a null value? So it is shrinking the skeleton’s bone scales, but not the scale of the SK_Mesh itself. Hmm.

Does it still thin them out when you DO NOT use the ragdoll node?

Check settings for the skeleton and the BP_Base_Unit itself and make sure there’s no places with scale locked- or possibly not parented to the root. That could be an issue here. :slight_smile:

2 Likes

Hey, thanks a lot for the reply!

mmm, was this not in the video?
I’d like you to be more specific with your question, like is this after or before the shrink/grow? (Set Actor 3D Scale)

If I scale the character during runtime, it gets scaled correctly aside from the ROOT (Which in this case is the capsule, for whatever reason)
Then when I enable ragdoll it deforms.
(But as I have tested, even if the root is NOT the capsule, it still does the same problem)

If i have it as scale 100XYZ before “Game Start” (ie default scale) and enable ragdoll, it DOESN’T deform.

So yes, somehow the scale node is acting differently during runtime for whatever reason.
Speaking of this… if I use scale node in the construction script, it works correctly. (ie the Capsule also gets scaled)

I hope my answer is what you wanted.

No worries!

So this is what I meant:
image
Have you tested the scale node WITHOUT the Enable Ragdoll event?
Basically, the point of this is to see if it’s an interaction BETWEEN these two nodes, instead of assuming it’s the “SetActorScale3D” node specifically. :slight_smile:

Ah okay, well yes in the video at 1:19, you can see I added a delay between the scale node, and the ragdoll node.

Then, once you see the character shrink at 1:34
The Ragdoll node still has a 3 seconds delay. (So it didn’t trigger just yet)

Okay, yes, I do see that now!

Have you tried using “SetWorldScale3D” on the capsule here, ONLY on the root (collision) to make the entire thing shrink? That’s usually how I go about it, honestly. I haven’t had any issues with that one, I don’t know that I’ve ever used ScaleActor3D. I think the issue here is that there is a SK_Mesh involved, possibly?

Try “GetComponent” → “Capsule Collider” off of your BP_Base_Unit and use “SetWorldScale3D” on that. :slight_smile:

Hey, I’m glad you see it now!

So, I’ve tried everything you’ve mentioned…
And to make sure the problem is NOT with my own character, I actually specifically opened a default unreal engine 5 project. (Third person)

and I did the exact same steps.
You can find my attempts here in this video:


But then I just saw your latest reply.

So here’s another video showcasing the result. (Didn’t work)

Edit2: And Yes, I also tried with the relative scale node, it still didn’t work.


I hope this helps.

Edit: Am I suppose to use a component named “PhysicalAnimation” to do what I want?
or is this just something very different?
image

Now hold on there! You’re not going to get anywhere thinking any one action will fix your problem! :stuck_out_tongue:

That DID do something different. The character shrank! Progress!
Granted, the collision did not. But the mesh did, flawlessly!
But the stretching happened AFTERWARDS when the ragdoll effect activated.

When you set Simulate Physics to True on something, it will deparent from its parent. That seems like the thing to investigate here.

Since you are activating simulate physics after the scale, it is deparenting and using certain relative values based on the original size generated at runtime vs the new scaled size.
Try setting the scale specifically for the mesh.

All that said, I have absolutely no idea why that collision capsule is not changing size and it’s stumping me.

1 Like

Same problem…
However when I change it manually in the world, it somehow magically works…

So… I have no idea how or why…

Though thanks a lot for your technical viewpoint, I didn’t think of it that way, and hopefully it could help us solve this…


On another note, I think it’s interesting to note that the scale down of 2.0XYZ somehow translated to 0.4 in the mesh.

Or maybe that’s irrelevant…? its just some math to make sure it gets scaled correctly?

Hey, I found something very interesting…
When changing the mesh’s size manually, somehow it gets de-parented from the root, and goes into the “Components” section…???

I’ve never seen anything like this, and i have no idea if this is normal or not.

BEFORE:

After:

Does this help…? or just adds a pile of more questions? xD

I… WHAT??

Okay, that’s bizarre. It doesn’t seem like a bug though, it seems intentional to get the thing that needs scaling to be scaled correctly without interaction with the parent.

Yeah I think this is just going to take a massive amount of playing around.

Or… You could make a smaller “Alternate” version of the characters. Have another, smaller capsule parented to the root, with another, small skeletal mesh and activate those immediately before disabling the larger counterparts and vice versa?

Wow, well, In a sense I’m glad I’m not losing my mind, and this is actually NOT NORMAL.
But I’m put in a corner cuz I need this feature XDDD

I appreciate your suggestion regarding the “Alternate” version, though it just sounds like a lot of effort to do for something that’s “Supposed” to be simple.
I might do this as a “Last resort”… maybe…

So… I guess I can only try and play around more with this…
like what if I try to re-size twice? or what if I use a console command to resize it? and so on…

If you have other ideas of tests I could make, that would be helpful.
and if you have any more technical info/context about this, I’d appreciate it.

I think I’m pretty much tapped. I’ll ask one of my colleagues to take a look and see if they have any additional input!

But the “alternate” would actually be not a whole lot of effort.
Just “Enable Static mesh 2”, “Enable Capsule Collider 2”, Disable Static Mesh 1, Disable Static mesh 1.

Then just reverse for sizing back up.
You could probably use a timeline and lerp the size of one of them to similate a shrinking and growing effect before switching them out.

1 Like

Hello!
Just in case someone else read this post.
After changing the scale of an actor using SetActorScale3D you need to do a call to
mesh->RecreatePhysicsState() and
mesh->RecreateClothingActors() if the scaled mesh has cloths.

Both methods need to be called from C++ or create a method from c++ to be called in bp.