Ragdoll Skeletal Mesh on Physics handle is too heavy

Hello Forums.

I want an AI npc to grab the player character at a specific bone and have them ragdoll on that bone. The problem I am facing is that when i do this, the players skeletal mesh attaches and ragdolls just fine but it slouches to the floor too much. Like its too heavy. What i want is a more rigid and controlled grab.

It does work and grab the correct place and drag it around, but the player skeletal mesh is always falling to the floor.

Things i have tried:

Setting the physics handle settings to all kinds of configurations in the range of 0 to 1000000. (Linear stiffness, damping etc)
Setting the mass of all the bodies in the physics asset to 0.001.
Trying simulated and kinematic on all PhaT bodies.

Thanks in advance.

I suggest checking the linear limits on contraints in the Sketal Meshes’s physics asset. Think the problem is around that more likely not from handle itself, since even though you change the masses on physics assets its still a mass and can touch ground if there is soft limits on contstraints.

Addiitional screenshots would be helpfull even video around the topic.

1 Like

The linear limits are currently set to locked. If I set them to limited and set the number to 10 for example, then the mesh splits apart and ends up slinking back to the ground as usual. If i set it higher than this, it completly decouples the mesh parts and spreads them weirdly.

Either way its not working for me. Is it only certain parts that need the limits set? Im working with a normal humanoid skeleton so if you have any suggestions, its nothing too out of the ordinary in the bone structure department.

Allright, if your constraints and overall setup are correct and you are actually making a partial ragdoll (not full ragdoll sim), it should be fine.

What can be possible scenarios:

Possibility: If you are not making a partial ragdoll. For example, you grab by neck and SetAllBodiesBelowSimulatePhysics(neck) it should be fine. If you are doing more than that, like full body simulation or somehow simulating the grabbing chain itself, then physics body can get into a race condition between the bone and the physics handle. Make sure the grabbed bone itself is not toggled simulated. Maybe just to debug you can make only one arm chain or leg chain simulated and see if its behaving the same if not this is eliminated.

Possibility: There could be collision between player and the AI at that moment, so physics is being interfered and causing the body to act weirdly. Long shot but possible. Alt C see collisions maybe just a quick check if not this is eliminated.

Possibility: There could be linear limits on the physics handle acting weird because of mass distribution. Try setting it locked and see if it changes anything.

Possibility: If the physics asset was created long time ago and retargeted etc, there can be leftovers or mismatches. I would at least try to diagnose with a default skeletal mesh and see if the asset is the problem or not.

These are the top of my mind possibilities tbh.

1 Like

Firgured this out last night. The best way to do this is with a physics contraint component in the actor that grabs the other actor. In this example i used a npc to grab the player character by the neck.

These are the settings for the physics contraint.

You have to make adjustments to the Ref Frames transform to get your desired rotations once constrained. (Otherwise it defaults to the bones rotation) You also may have to disable some collision respones so the physics asset dont bounce off each other. Either way it works.

Also helps if the physics constraint component is parented to the mesh at the desried bone or other primitive component you want it attached to.

1 Like

Physics Constraint and Physics Handle are different concepts even though they have similarities.

Physics Handle is basically a spring attachment, that’s why I was talking about stiffness and limits. But it’s good that you changed the approach.

Another thing is that if the goal is just to attach one skeletal mesh to another, you don’t even necessarily need a Physics Constraint. You can get references to both skeletal mesh components, use Attach Component to Component, and that’s it. Then detach when needed. It depends on what kind of behavior you want.

As a side note: physics interactions are not dependent on just one variable. They depend on many things in a project substepping, async physics, collisions, collision definitions, stiffness, mass, forces, limits. Many things can go wrong, as mentioned above, and the possibilities are not limited to those even animation definitions, physics body setup, etc. It would be better next time to demonstrate the problem at least with some screenshots, and even better with a short video.

1 Like

There is indeed a lot more too it than a few settings in a constraint, but I already had the rest set up. I have managed to achieve the desired results with the constraints so all is well and good.

The problem with using attach actor to actor or attach component to component is that:

A.) You can only specify the attached bone/socket for one component
B.) As soon as you ragdoll or simulate physics, it will detach automatically.

I did look at this first but could not get a desired result. I see now that constraints is what i needed as using the physics handle requires more work, which would in turn make my character physics asset not behave correctly with the other things i have it set up for.

I will mark this as solved and hopefully this will help someone in the future. Once again, thank you for the help.

My pleasure.

Well its not that black and white to be honest its true if you simulate all, if you don’t simulate the attachment bone itself, it won’t detact.

As can be seeen

7

Thought a demo can be helpfull on your side but its completely up to you and your needs around the behaviour of things.

Happy developing.

1 Like