Using Blend Physics Weight causes skeletal mesh to spin at high speed

Hi everyone,

I’m trying to blend some animation in with my physics-simulated octopus. [You can check out what it looks like here.][1]

Right now I’m just trying to get the system to work at all. In blueprint, I tried enabling Physics blending using Set Enable Physics Blending, then using Set All Bodies Below Physics Blend Weight to get just the tentacles to animate, while you can still roll around the head. The animation I’m blending with is just the bind pose right now, held for 24 frames and keyed on the tentacles’ bones. I’ve tried with keying all the bones, and actually animating some of the tentacles, but I get the same result no matter what.

What I see as a result right now, no matter what value I plug in for Physics Blend Weight (besides fully 0.0 or 1.0) causes the skeletal mesh to spin at incredible speeds about its center.

If I set the Blend Weight to something approaching 1.0, I can regain some control of the character, but it seems to have disabled the physical weight of the bodies it’s animating, so the controls get very broken. Additionally, if I set the value closer to 0.0, then collision gets disabled for the tentacles, allowing the model to pass through things with its tentacles.

Anyone have any experience with this system that can point me to where I might be going wrong? I tried fiddling with some settings and configs that I thought might cause this issue. My first thought was that maybe it was the depenetration of the PhAT causing this. I made a new PhAT that had no overlap at all, and it exhibited the same behavior.

This is in 4.7r4. Thanks! Let me know if I can provide any more info that can help to get to the bottom of what’s going on.

As of 4.7p5 this is still happening. Going to try preview 6 tonight. Anyone have any idea what I might have screwed up if it’s on the content side?

On 4.7p7 this still happens. Any insight?

As of 4.7p8 this is still happening. No idea what about my setup might be causing this. Is anyone available to take a look?

Sure ! Is there a way I can send it to you over private message?

Hi ,

I have not been able to reproduce this issue.Can you provide the Octupus and corresponding assets? (The entire environment/game not necessary.)

Thanks

Hi ,

You can send it as a zip file as an attachment to me in a private message on the .

Thanks

Hey , I shot you a link to this project over the . Any luck? Thanks for taking a look!

Hi ,

I looked at your project and was able to reproduce the issue. I’ve written this up as a bug in the following report. JIRA [UE-11382]. If the developers are able to isolate and correct this issue an update will be added to this post.

If it turns out not to be a bug, a solution or explanation regarding the use of the Physics Blend feature will be posted.

Thanks

Awesome! Thanks !

Hi ,

I was able to talk to a developer about this and he said the way the tool is mean to be used is by blending with an existing animation. So, as you approach 1 the blend is more controlled by physics, as you reduce the blend towards 0 the animation influences the movement more until you reach 0 where movement is completely driven by the animation.

Because there is no animation present, it reacts in a unpredictable manner as you move from one down to zero. Although this has not been perfected yet, it is not necessarily considered a bug either and the developers are aware of this.

Hey , there actually is an animation present. I made the simplest one I could think of for debugging, so it’s just keyed a few frames in its bind pose.

I tried the same setup with an animation (Pulling tentacles towards its mouth) and it did indeed blend the physics with the animation, but it also forced the model to spin at ludicrous speeds. Thanks for looking into this!

Hi ,

I was eventually able to test with the animation you provided as well as one I created with more frames and was able to reproduce the issue. I’ve checked with the developer regarding the report already submitted and they said that they are indeed looking into this as a bug.

Thanks for your feedback

Hey ,

I’m really suffering from this issue trying to get the character to blend to a get up animation and no matter what I do, it always spins like crazy. If I don’t do blending, the character does snap from the Ragdoll to the animation and gets up properly, but its just a little jarring atm. Has there been any update regarding [UE-11382] since last year?

Thanks again!

This has been updated to [UE-19252] for future reference and is still in line to be worked on. I have added a comment regarding increased community interest, however, I cannot offer an estimate for when this will be resolved.

Thank you for the immediate response, really appreciate that :slight_smile:

Also thanks for the updated reference. That’s perfectly fine and understandable.

I did quite a bit of research and I even came across this video series that has things set up almost to the T however this dev came across the same issue and this could be related. I think this video will give you and some of the other dev staff an idea of where this could be coming from to help nail down the issue.

Now I set my character up like he did in PHAT with a default Sphyl at the Root Bone in the skeleton and set it to “Kinematic”… this gets the simulation within PHAT to blend with the animation like this person did however anytime I enable ragdoll, the character gets shot off into the void quite literally straight up in the air.

Let me show you some of the code I’m using to activate/blend this. Note that this works without the blending, however it snaps between ragdoll and animation.

Need to add this to another comment due to character length :stuck_out_tongue:

EDIT: For some reason, Answer Hub isn’t accepting me clicking on Comment to send the next msg… hang tight

if (IsCharacterRagdoll)
{
// Update the Capsule’s World Space Location
GetCapsuleComponent()->SetWorldLocation(GetMesh()->GetSocketLocation(RagdollRootBone) +
FVector(0.f, 0.f, GetCapsuleComponent()->GetScaledCapsuleHalfHeight()));

			if (!IsGettingUp && !GetCharacterMovement()->IsFalling()) // && !GetCharacterMovement()->IsMovingOnGround())
			{
				if (!GetWorldTimerManager().IsTimerActive(OnGettingUp_Timer))
					GetWorldTimerManager().SetTimer(OnGettingUp_Timer, this, &ATDCharacter::OnGettingUp, GetUpDelay);
				IsGettingUp = true;
			}
		}
		else if (GetCharacterMovement()->IsFalling())
		{
			GetMesh()->SetCollisionProfileName(TEXT("Ragdoll"));
			GetMesh()->SetAllBodiesBelowSimulatePhysics(RagdollRootBone, true);
			GetMesh()->SetAllBodiesBelowPhysicsBlendWeight(RagdollRootBone, 1.f);

			// May not be needed
			//GetMesh()->WakeAllRigidBodies();

			CurrentPhysicsBlendAlpha = 1.f;
			TargetPhysicsBlendAlpha = 1.f;

			IsCharacterRagdoll = true;
		}

// Only need to support blending to 0 for now
if (CurrentPhysicsBlendAlpha != TargetPhysicsBlendAlpha && TargetPhysicsBlendAlpha == 0.f)
{
CurrentPhysicsElapsedTime += DeltaTime;
if (CurrentPhysicsElapsedTime >= PhysicsBlendDuration)
{
CurrentPhysicsElapsedTime = 0.f;
CurrentPhysicsBlendAlpha = TargetPhysicsBlendAlpha;
}
else
CurrentPhysicsBlendAlpha = 1.f - (CurrentPhysicsElapsedTime / PhysicsBlendDuration);

			GetMesh()->SetAllBodiesBelowPhysicsBlendWeight(RagdollRootBone, CurrentPhysicsBlendAlpha);
	
			if (CurrentPhysicsBlendAlpha == 0.f)
			{
				GetMesh()->SetCollisionProfileName(TEXT("Minion"));

				///GetMesh()->SetRelativeTransform(MeshRelativeTransform);
				GetMesh()->AttachTo(GetCapsuleComponent(), NAME_None, EAttachLocation::SnapToTarget, true);
				GetMesh()->SetRelativeTransform(MeshRelativeTransform);

				GetMesh()->SetAllBodiesBelowSimulatePhysics(RagdollRootBone, false);
				IsCharacterRagdoll = false;
			}
		}

EDIT: Oh and all this code above exists in the Tick function. Also here’s another thread where another user had to modify some engine code to get it to work for him. I can’t modify the engine source in this project specifically atm so I can’t validate that but maybe it adds a little more regarding the issue. (Animated pawn to go ragdoll and back to animations - World Creation - Unreal Engine Forums) Thanks!

Thanks for the linked video and code. I have added these to the bug report in hopes that they may expedite a resolution to the problems faced when blending between animation and ragdoll. Once corrected, we will update this post to let you know.

Absolutely and thanks again for the assistance! I’ll come back to this issue soon myself and try what I can to crack this issue. Something tells me if Jonas was able to get this working in his project (albeit via BP instead of C++) with UE4Man, maybe its a result of something within the PHAT setup needing a little assistance however I’ll note that during simulation + blending into multiple anims within PHAT, it does work so maybe not. I’ll keep my fingers crossed on any future updates. Take care!