Dear Epic,
I am using the following C++ code to try and initiate a partial-ragdoll state so I can apply an impulse at a point of impact to a humanoid skeletal mesh holding a weapon
#Background
Again this is a perfectly normal humanoid skeleton based on 3ds max biped.
I have plenty of animations playing on the mesh
I know the ragdoll itself works great and does not go bonkers during simulation.
If I just activate ragdoll completely, the ragdoll behaves normally
#The Blend Code
Here is my blend code
//set partial rag doll for a period of time
PartialRagDollActive = true;
SETTIMER(AVCharCombat::ClearPartialRagdoll,1,false);
//GetMesh()->SetAllBodiesBelowSimulatePhysics("Bip01-Spine2",true);
GetMesh()->bBlendPhysics = true;
GetMesh()->bEnablePhysicsOnDedicatedServer = true;
GetMesh()->SetAllBodiesBelowPhysicsBlendWeight(
"Bip01-Spine2",
0.5 //weight for all
);
GetMesh()->AddImpulse(Hit.ImpactNormal * 30000, "Bip01-R-Hand");
#Result
Using this code, nothing happens at all (the timer currently does not do anything after firing, so I am fully testing whether I ever get blending of physics to work
#Other Code Path
If I uncomment the setting of simulate directly
GetMesh()->SetAllBodiesBelowSimulatePhysics("Bip01-Spine2",true); //<~~~
GetMesh()->bBlendPhysics = true;
GetMesh()->bEnablePhysicsOnDedicatedServer = true;
GetMesh()->SetAllBodiesBelowPhysicsBlendWeight(
"Bip01-Spine2",
0.9 //weight for all
);
Now the upper body goes into total ragdoll, perpetually, never settling, and this happens whether I use a blend wait of 0.1, 0.5, or 0.9.
In other words, its all or nothing! Either the arms are completely limp, not playing the standing/idle/swinging animations even a little bit, or the animations are in complete control.
I cannot get partial ragdoll, only full on ragdoll or no ragdoll
#What Works
I can successfully get the upper body bones to enter ragdoll 100%, and then get them back out, while legs continue to play normal animations.
The issue is that I want the animations to have a partial influence on the upper body, while the rag doll impulse dislocates the bones from normal positions, simulating a recoil from a weapon impact.
It is this partial ragdoll influence upon the existing upper body animations that I cannot figure out how to achieve.
#Summary
I cannot figure out how to have a partial ragdoll state at all, please help! Thanks!
#
Rama
PS: Even only having upper body simulate physics was going completely bonkers until I changed the collision of the mesh to be “Ragdoll” instead of Character mesh.
Now the arms flop around great, but its 100% ragdoll, all the time, not a blend
Thanks!