diff --git a/Source/Patches/ItemPatches.cs b/Source/Patches/ItemPatches.cs index 813239e0..e8771fa8 100644 --- a/Source/Patches/ItemPatches.cs +++ b/Source/Patches/ItemPatches.cs @@ -1,5 +1,7 @@ using HarmonyLib; using LCVR.Items; +using LCVR.Player; +using UnityEngine; namespace LCVR.Patches; @@ -30,4 +32,12 @@ private static void LateUpdatePostfix(GrabbableObject __instance, bool __runOrig if (!__runOriginal && __instance.radarIcon != null) __instance.radarIcon.position = __instance.transform.position; } + + [HarmonyPatch(typeof(GrabbableObject), nameof(GrabbableObject.GetItemFloorPosition))] + [HarmonyPrefix] + private static void GetItemFloorPositionFromHand(ref Vector3 startPosition) + { + if (startPosition == Vector3.zero) + startPosition = VRSession.Instance.LocalPlayer.RightHandVRTarget.position; + } }