Hi,
I’ve recently come across an error concerning the FLateUpdateManager in UE 4.18.
In my game, I implemented the functionality to switch between a “normal” flying spectator and a VR pawn.
The pawn is switched on the server and then replicated to the client.
When I launch a game and connect with a second spectating player it all works fine.
The problem occurs when I switch to the VR pawn on the 2nd player.
The game of the 2nd player crahes in:
FLateUpdateManager::GatherLateUpdatePrimitives(USceneComponent* ParentComponent)
Line 75: check(Component != nullptr);
I have debugged into the code and the call to
ParentComponent->GetChildrenComponents(true, Components);
returns an array of all the child components, but it is filled with some nullptr values.
I believe this is due to the fact that the pawn gets created on the server and is then replicated to the client, but maybe not “fast” enough so that some components have a placeholder value (nullptr).
To work around the problem i set
bDisableLowLatencyUpdate = true;
on the UMotionControllerComponent.
But, for the camera there is no such command.
All I can think of is to override the
UCameraComponent::GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView)
method and to remove the call to the
XRCamera->SetupLateUpdate(ParentWorld, this);
which calls
voids FLateUpdateManager::Setup(const FTransform& ParentToWorld, USceneComponent* Component)void FLateUpdateManager::GatherLateUpdatePrimitives(USceneComponent* ParentComponent)
check(Component != nullptr); → Crash
This seems to me like an awful and hacky workaround.
Is there some better way to assure that these calls don’t occur or only get called if the components are properly initialized?
Or wouldn’t it be better to assure that the method “void USceneComponent::GetChildrenComponents(bool bIncludeAllDescendants, TArray& Children)” does not contain any nullptr values or ignore any nullptr components in “FLateUpdateManager::GatherLateUpdatePrimitives”?
Thank you for your help!
Best regards,
ZABBA