For a few days I have been experiencing an inexplicable teleportation in my skeletal mesh.
I find out this function is responsible.
SetAllBodiesSimulatePhysics(true);
When this function is executed my skeletal mesh is teleported to the place where the pawn was spawned (The PlayerStart Location).
This did not happen to me in any of the previous versions to UE5.5.1
I really don’t know if it’s the version that’s to blame for this.
I’ve really been trying to do some skeletal mesh optimization these past few days…
bEnableUpdateRateOptimizations = true;
bComponentUseFixedSkelBounds = true;
bDisplayDebugUpdateRateOptimizations = false;
bUseScreenRenderStateForUpdate = true;
bReplicatePhysicsToAutonomousProxy = true;
bRenderStatic = false;
bUseAttachParentBound = true;
bSkipBoundsUpdateWhenInterpolating = true;
bSkipKinematicUpdateWhenInterpolating = true;
bNoSkeletonUpdate = false;
bPauseAnims = false;
//bDisableRigidBodyAnimNode=true;
KinematicBonesUpdateType = EKinematicBonesUpdateToPhysics::Type::SkipAllBones;
//MeshComponentUpdate::OnlyUpdateWhenRendered;
AnimUpdateRateParams->bShouldUseLodMap = true;
AnimUpdateRateParams->BaseNonRenderedUpdateRate = 4;
AnimUpdateRateParams->LODToFrameSkipMap.Add(0,0); //[LOD, FPS]
AnimUpdateRateParams->LODToFrameSkipMap.Add(1,1);
AnimUpdateRateParams->LODToFrameSkipMap.Add(2,2);
AnimUpdateRateParams->LODToFrameSkipMap.Add(3,3);
AnimUpdateRateParams->LODToFrameSkipMap.Add(4,4);
AnimUpdateRateParams->MaxEvalRateForInterpolation = 10;
AnimUpdateRateParams->BaseNonRenderedUpdateRate = 6;
VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;
But I have /* commented */ them and I am still experiencing the problem.
My ragdoll code is the same since UE4.27 version
void UCharacterSkeletalMehs::RagDoll()
{
SetGenerateOverlapEvents(false);
CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Yes;
SetCollisionEnabled( ECollisionEnabled::PhysicsOnly );
SetCollisionObjectType( ECollisionChannel::ECC_Pawn );
SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
SetCollisionResponseToChannel( ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Block);
// Enable ragdoll physics
SetAllBodiesSimulatePhysics(true);
SetSimulatePhysics(true);
WakeAllRigidBodies();
bBlendPhysics = true;
}
Does this happen to anyone else?
Because if I know it’s a problem with the UE5.5.1 version then I stop looking for bugs in my code and wait for the U5.5.2 version.
Otherwise I’ll keep looking for bugs in my code.
Thank you very much for the help!!