SkeletalMesh invisible/flickering in Packaged Version

Hello,

in PIE my Game works great,
but when i package it, the Skeletal Mesh starts to flicker or sometimes gets fully invisible.
I tried everything metioned about occlusion culling causing meshs to flicker (increasing bounds, even disable occlusion culling complete in settings), but nothing helps.

Does anyone know what changes for culling or visibility when packaging a game,
or does anyone know a different approach to solve this problem?

Thank you for any ideas,

Hi ,

Can you post any additional details for setup to reproduce this in a fresh project? Even a video demonstration of the issue to clearly show what is going on, how close the camera is to the player character, or any other conditions that would be helpful to ascertain what is going on.

If disabling Occlusion Culling did not resolve the issue, even as a test, there is likely something else going on, so the more details the better, and if you can reproduce in a one of the template or blank projects that’s even better to see if I can see the same on my end.

Thank you!

Tim

Hello Tim,

thank you for your reply,
i try to set up a blank project and reproduce the problem.

Best wishes

Hello,

I broke down my project, the problem is caused by these functions:

// Change Group 1
void AMyProduct::switchObjekt1(FString boneName)
{

	for (auto &object: ObjectsToHide){
		MyMesh->HideBoneByName(object->boneName, EPhysBodyOp::PBO_Disable);
	}

	MyMesh->UnHideBoneByName(FName(*boneName));

	Cast<UMyGameInstance>(GetGameInstance())->BoneVisibilityStates = MyMesh->BoneVisibilityStates;

	recalculateBounds();
}


void AMyProduct::hideCollisionBodiesForInvisibleBones(){
	
	for (auto& Elem : MyMesh->GetPhysicsAsset()->BodySetupIndexMap)
	{
		// IF Bone is Hidden, Hide Collision Body
		if (MyMesh->IsBoneHiddenByName(Elem.Key)){
			MyMesh->GetBodyInstance(Elem.Key)->SetResponseToAllChannels(ECollisionResponse::ECR_Ignore);
			MyMesh->GetBodyInstance(Elem.Key)->SetResponseToChannel(ECollisionChannel::ECC_PhysicsBody, ECollisionResponse::ECR_Ignore);
			MyMesh->GetBodyInstance(Elem.Key)->SetCollisionEnabled(ECollisionEnabled::NoCollision);
			MyMesh->GetBodyInstance(Elem.Key)->UpdateBodyScale(FVector(0));
		}
		// IF Bone is Visible, Make Collision Body Clickable
		else{
			MyMesh->GetBodyInstance(Elem.Key)->SetResponseToAllChannels(ECollisionResponse::ECR_Block);
			MyMesh->GetBodyInstance(Elem.Key)->SetResponseToChannel(ECollisionChannel::ECC_PhysicsBody, ECollisionResponse::ECR_Block);
			MyMesh->GetBodyInstance(Elem.Key)->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
			MyMesh->GetBodyInstance(Elem.Key)->UpdateBodyScale(FVector(1));
		}

	}
	recalculateBounds();
	
}

//Re-Calculate Bounding-Box to remove Flickering
void AMyProduct::recalculateBounds(){
	MyMesh->Bounds = MyMesh->CalcBounds(FTransform());
	MyMesh->BoundsScale = 1.25;
	MyMesh->UpdateBounds();
}

I work with a Skeletal Mesh where some parts overlap,
with these functions I want to hide one part and show the other.
The Bodies of the hidden Mesh-Parts shall be disabled, so only the visible Mesh-Parts are clickable.

My functions work around the missing implementation of “EPhysBodyOp::PBO_Disable” in “SkeletalMeshComponent::HideBoneByName()”. Maybe there starts the problem - the missing implementation is already registered as UE-19860.

Best wishes