From e302d90678eb712df21dc4560d8d7a5d9c39fdc8 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Mon, 27 Jan 2025 19:36:21 +0100 Subject: [PATCH] use engine api to set the tracking motion source --- .../Components/SGWristTrackerComponent.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp index 7197e34d..587ab3a2 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp @@ -350,19 +350,12 @@ void USGWristTrackerComponent::FImpl::UpdateMotionSource() const return; } - UWorld* World{Owner->GetWorld()}; - if (!World) - { - return; - } - - if (World->IsGameWorld() && Owner->HasBeenInitialized()) - { - Owner->MotionSource = Owner->IsRight() - ? Owner->GetWristTrackingSettings().RightHandMotionSource - : Owner->GetWristTrackingSettings().LeftHandMotionSource; - FMotionDelayService::RegisterDelayTarget(Owner, Owner->PlayerIndex, Owner->MotionSource); - } + const FName& TrackingMotionSource{ + Owner->IsRight() + ? Owner->GetWristTrackingSettings().RightHandMotionSource + : Owner->GetWristTrackingSettings().LeftHandMotionSource + }; + Owner->SetTrackingMotionSource(TrackingMotionSource); } void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const