Skip to content

Commit

Permalink
Item dropping from real life hand position
Browse files Browse the repository at this point in the history
  • Loading branch information
DaXcess committed Jul 27, 2024
1 parent 04cdf28 commit 8806030
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/Patches/ItemPatches.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using HarmonyLib;
using LCVR.Items;
using LCVR.Player;
using UnityEngine;

namespace LCVR.Patches;

Expand Down Expand Up @@ -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;
}
}

0 comments on commit 8806030

Please sign in to comment.