From b1e586a34bc2dc85861870256e7e32d88485fa8b Mon Sep 17 00:00:00 2001
From: jehret <ehret@vr.rwth-aachen.de>
Date: Wed, 11 Dec 2019 15:35:36 +0100
Subject: [PATCH] add a comment for the tick as required by Simon
---
Source/WidgetInteraction/Private/WidgetInteraction.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Source/WidgetInteraction/Private/WidgetInteraction.cpp b/Source/WidgetInteraction/Private/WidgetInteraction.cpp
index 1b7b698..4b0c537 100644
--- a/Source/WidgetInteraction/Private/WidgetInteraction.cpp
+++ b/Source/WidgetInteraction/Private/WidgetInteraction.cpp
@@ -23,9 +23,9 @@ void FWidgetInteractionModule::ShutdownModule()
void FWidgetInteractionModule::OnWorldTickStart(ELevelTick level_tick, float val)
{
- //called every Tick()
-
- auto worlds = GEngine->GetWorldContexts();
+ //since OnWorldTickStart is called independent of the world/level we are in,
+ //we need to check whether the level changed and, if so, reattach the interaction component
+ auto worlds = GEngine->GetWorldContexts();
for (auto world_context : worlds) {
--
GitLab