From b07d8b77f751ed0df037a98d8564aad98148064a Mon Sep 17 00:00:00 2001 From: whateverusername0 Date: Thu, 20 Apr 2023 00:32:56 +1000 Subject: [PATCH] the height fix in question: --- .../VRTRAKILL/VRPlayer/Movement/VRPlayerController.cs | 8 +++++--- VRTRAKILL/VRTRAKILL/VRPlayer/Patches/PlayerP.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VRTRAKILL/VRTRAKILL/VRPlayer/Movement/VRPlayerController.cs b/VRTRAKILL/VRTRAKILL/VRPlayer/Movement/VRPlayerController.cs index 014f0490..3e642961 100644 --- a/VRTRAKILL/VRTRAKILL/VRPlayer/Movement/VRPlayerController.cs +++ b/VRTRAKILL/VRTRAKILL/VRPlayer/Movement/VRPlayerController.cs @@ -11,13 +11,15 @@ private void Start() CC = GetComponent(); } - private void Update() + private void FixedUpdate() { // Update player's height float DistanceFromFloor = Vector3.Dot(Vars.VRCameraContainer.transform.localPosition, Vector3.up); - CC.height = Mathf.Max(CC.radius, DistanceFromFloor); + + if (NewMovement.Instance.sliding) CC.height = Mathf.Max(CC.radius, DistanceFromFloor - 0.35f); + else CC.height = Mathf.Max(CC.radius, DistanceFromFloor); CC.center = Vars.VRCameraContainer.transform.localPosition - 0.5f * DistanceFromFloor * Vector3.up; } } -} +} \ No newline at end of file diff --git a/VRTRAKILL/VRTRAKILL/VRPlayer/Patches/PlayerP.cs b/VRTRAKILL/VRTRAKILL/VRPlayer/Patches/PlayerP.cs index 64d69e84..b893447b 100644 --- a/VRTRAKILL/VRTRAKILL/VRPlayer/Patches/PlayerP.cs +++ b/VRTRAKILL/VRTRAKILL/VRPlayer/Patches/PlayerP.cs @@ -6,7 +6,7 @@ namespace Plugin.VRTRAKILL.VRPlayer.Patches [HarmonyPatch(typeof(NewMovement))] internal class PlayerP { - // before the patch the player was like TWICE as big and was TWICE as faster + // before the patch the player was like TWICE as tall, now it's height is controlled by VRPlayerController [HarmonyPrefix] [HarmonyPatch(nameof(NewMovement.Start))] static void SetupVRController(NewMovement __instance) { __instance.gameObject.AddComponent();