diff --git a/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp index 08d44b21a4e33283daa9a6a29b556beec0289cfa..1b3560ff157085b962013191b75013aac266fb2d 100644 --- a/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp +++ b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp @@ -282,7 +282,7 @@ void ACAVEOverlayController::SetSignsForHand(UStaticMeshComponent* Sign, const F { const bool bHandIsCloseToWall = FMath::IsWithinInclusive(HandPosition.GetAbsMax(), WallDistance - WallCloseDistance, WallDistance); - if (bHandIsCloseToWall && !PositionInDoorOpening(HandPosition)) + if (bHandIsCloseToWall && !PositionInDoorOpening(HandPosition) && Sign && HandMaterial) { Sign->SetVisibility(true); HandMaterial->SetScalarParameterValue("SignOpacity", CalculateOpacityFromPosition(HandPosition)); @@ -300,7 +300,7 @@ void ACAVEOverlayController::SetSignsForHand(UStaticMeshComponent* Sign, const F const auto Pos = FVector(X, Y, Z); Sign->SetRelativeLocationAndRotation(Pos, Rot); } - else + else if (Sign) { Sign->SetVisibility(false); }