diff --git a/Patches/Core/Player/WeaponPatches.cs b/Patches/Core/Player/WeaponPatches.cs index 833e54f..f3ed583 100644 --- a/Patches/Core/Player/WeaponPatches.cs +++ b/Patches/Core/Player/WeaponPatches.cs @@ -722,6 +722,8 @@ private static void SetOpticCamFoV(EFT.CameraControl.OpticComponentUpdater __ins VRGlobals.vrPlayer.scopeUiPosition = __instance.transform_0.FindChild("backLens"); opticSight.gameObject.layer = 6; scopeCollider = opticSight.GetComponent(); + if (!scopeCollider) + scopeCollider = opticSight.transform.parent.GetComponent(); } if (scopeCollider) { @@ -736,11 +738,16 @@ private static void SetOpticCamFoV(EFT.CameraControl.OpticComponentUpdater __ins VRGlobals.vrOpticController.currentFov = fov; } - if (opticSight.name.Contains("mode_")) - opticSight.transform.parent.GetComponent().enabled = true; - else + if (opticSight.name.Contains("mode_")) { + if (opticSight.transform.parent.GetComponent()) + opticSight.transform.parent.GetComponent().enabled = true; + else if (opticSight.transform.parent.parent.GetComponent()) + opticSight.transform.parent.parent.GetComponent().enabled = true; + } + else if (opticSight.GetComponent()) opticSight.GetComponent().enabled = true; - + else if (opticSight.transform.parent.GetComponent()) + opticSight.transform.parent.GetComponent().enabled = true; }