Motion Controllers in the wrong place

I have fixed the following code in my local engine.
The absence of “return” was obviously unnatural.



void FSteamVRInputDevice::Tick(float DeltaTime)
{

    ...

    else if(SteamVRHMDModule && SteamVRHMDModule->GetVRSystem())
    {
        // Cache the controller transform to ensure ResetOrientationAndPosition gets the correct values (Valid for UE4.18 upwards)
        // https://github.com/ValveSoftware/steamvr_unreal_plugin/issues/2
        if (GEngine->XRSystem.IsValid() && SteamVRHMDModule && SteamVRHMDModule->GetVRSystem())
        {
            CachedBaseOrientation = GEngine->XRSystem->GetBaseOrientation();
            CachedBasePosition = GEngine->XRSystem->GetBasePosition();

            //@third party code - BEGIN Fix SteamVR MotionController Transform Bug.
            return;
            //@third party code - END Fix SteamVR MotionController Transform Bug.
        }
    }

    CachedBaseOrientation = FQuat::Identity;
    CachedBasePosition = FVector::ZeroVector;
}



1 Like