use engine api to set the tracking motion source

This commit is contained in:
Mamadou Babaei
2025-02-14 12:11:13 +01:00
parent 31e03380c9
commit d8f7f7db59
@@ -350,19 +350,12 @@ void USGWristTrackerComponent::FImpl::UpdateMotionSource() const
return; return;
} }
UWorld* World{Owner->GetWorld()}; const FName& TrackingMotionSource{
if (!World) Owner->IsRight()
{ ? Owner->GetWristTrackingSettings().RightHandMotionSource
return; : Owner->GetWristTrackingSettings().LeftHandMotionSource
} };
Owner->SetTrackingMotionSource(TrackingMotionSource);
if (World->IsGameWorld() && Owner->HasBeenInitialized())
{
Owner->MotionSource = Owner->IsRight()
? Owner->GetWristTrackingSettings().RightHandMotionSource
: Owner->GetWristTrackingSettings().LeftHandMotionSource;
FMotionDelayService::RegisterDelayTarget(Owner, Owner->PlayerIndex, Owner->MotionSource);
}
} }
void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const