Download

4.5 Transition Guide, Community Contributions Welcome!

Dear Zak,

Hi Zak!

Well I’ve upgraded 3-4 different projects and talked to many different people and this change confused them all :slight_smile:

The only person whom it did not affect was someone with a BP-only project.

This was a very confusing change for people because the deprecated variable did not seem to transfer over in all cases as it should have and they had no idea where to even start looking for the end result of not being able to look up or down after upgrading.

But it is great to hear from you Zak!

Have fun today!

Rama

Hi Rama!

Yesterday I had taken apart your ragdoll code and gotten it to work in 4.4, but this morning after I upgraded to 4.5 and got the camera working again, the code is broken, and coming out of ragdoll mode spawns me underground. Have I done something wrong, or was there a change somewhere else that I’ve missed?


void AMyCharacter::ManualRagdollToggle()
{
	bIsInRagdoll ? ExitRagdoll() : EnterRagdoll();
}



void AMyCharacter::EnterRagdoll()
{
	//uses code from rama; thanks bru!

	if (!Mesh) { return; }
	if (!Mesh->GetPhysicsAsset()) { return; }

	RagdollInitLocation = Mesh->GetRelativeTransform().GetLocation();
	RagdollInitRotation = Mesh->GetRelativeTransform().Rotator();

	Mesh->SetPhysicsBlendWeight(1);
	Mesh->bBlendPhysics = true;

	bIsInRagdoll = true;
}

void AMyCharacter::ExitRagdoll()
{
	//uses code from rama; thanks bru!

	if (!Mesh) { return; }

	TArray<FName> BoneNames;
	Mesh->GetBoneNames(BoneNames);
	if (BoneNames.Num() > 0)
	{
		SetActorLocation(FVector(0, 0, 0) + Mesh->GetBoneLocation(BoneNames[0]));
	}
	Mesh->SetPhysicsBlendWeight(0);

	Mesh->SetRelativeLocation(RagdollInitLocation);
	Mesh->SetRelativeRotation(RagdollInitRotation);

	if (CharacterMovement) { CharacterMovement->SetMovementMode(MOVE_Falling); }

	bIsInRagdoll = false;
}

Hi there!

I am not sure and my current projects have not reached the ragdoll phase yet, when I re-implement ragdoll in 4.5 for one of my current projects I will let you know what I come up with!

Does the Victory BP Library version work?

I already got that compiling in 4.5

:heart:

Rama

I’ve never actually used Victory BP, I just reverse-engineered it, but I will give it a shot.

Edit: figured it out; somewhere in the EnterRagdoll function above, Mesh is unattaching itself from the root component.



FAnimMontageInstance->Position 


was previously public, but this member has been made private so you should now use



FAnimMontageInstance->GetPosition();


and



FAnimMontageInstance->SetPosition(float pos);