From 5b93b1b6506eff80fcc9caee9a915ebc77e39e42 Mon Sep 17 00:00:00 2001 From: Viktor Blomme Date: Thu, 23 Jan 2025 10:10:04 +0100 Subject: [PATCH] Reset tick --- .../Private/Chaos/GBFChaosCachePlayer.cpp | 10 ++++++++++ .../Public/Chaos/GBFChaosCachePlayer.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Source/GameBaseFramework/Private/Chaos/GBFChaosCachePlayer.cpp b/Source/GameBaseFramework/Private/Chaos/GBFChaosCachePlayer.cpp index fa5d5336..297ac5d1 100644 --- a/Source/GameBaseFramework/Private/Chaos/GBFChaosCachePlayer.cpp +++ b/Source/GameBaseFramework/Private/Chaos/GBFChaosCachePlayer.cpp @@ -31,4 +31,14 @@ void AGBFChaosCachePlayer::ResetObservedComponents() EndEvaluate(); SetStartTime( 0.0f ); BeginEvaluate(); +} + +void AGBFChaosCachePlayer::BeginPlay() +{ + Super::BeginPlay(); + + if ( !PrimaryActorTick.bStartWithTickEnabled ) + { + SetActorTickEnabled( false ); + } } \ No newline at end of file diff --git a/Source/GameBaseFramework/Public/Chaos/GBFChaosCachePlayer.h b/Source/GameBaseFramework/Public/Chaos/GBFChaosCachePlayer.h index 73a76151..0367e9aa 100644 --- a/Source/GameBaseFramework/Public/Chaos/GBFChaosCachePlayer.h +++ b/Source/GameBaseFramework/Public/Chaos/GBFChaosCachePlayer.h @@ -19,4 +19,6 @@ class GAMEBASEFRAMEWORK_API AGBFChaosCachePlayer : public AChaosCachePlayer UFUNCTION( BlueprintCallable ) void ResetObservedComponents(); + + void BeginPlay() override; };