diff --git a/Source/CAVEOverlay/Private/CAVEOverlayController.cpp b/Source/CAVEOverlay/Private/CAVEOverlayController.cpp index b3f224aafcb43a43fc95acb9577dec41c4b81d67..34a3c8ba545ee6dc7cfc0e81f2b154377c7d9f7a 100644 --- a/Source/CAVEOverlay/Private/CAVEOverlayController.cpp +++ b/Source/CAVEOverlay/Private/CAVEOverlayController.cpp @@ -33,6 +33,7 @@ ACAVEOverlayController::ACAVEOverlayController() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; + bAllowTickBeforeBeginPlay = false; AutoReceiveInput = EAutoReceiveInput::Player0; ConstructorHelpers::FClassFinder<UDoorOverlayData> WidgetClassFinder(TEXT("Blueprint'/CAVEOverlay/DoorOverlay'")); @@ -176,7 +177,7 @@ bool ACAVEOverlayController::positionInDoorOpening(FVector position) { } void ACAVEOverlayController::refreshPawnComponents(){ - static TArray<UDisplayClusterSceneComponent*> pawn_components; + TArray<UDisplayClusterSceneComponent*> pawn_components; player_pawn_->GetComponents<UDisplayClusterSceneComponent>(pawn_components); for (UDisplayClusterSceneComponent* c : pawn_components) { if (c->GetName().Equals("cave_origin", ESearchCase::IgnoreCase)) cave_origin_ = c;