-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HOPEFULLY fixed checkpoint camera tomfoolery
- Loading branch information
whateverusername0
committed
Apr 19, 2023
1 parent
834c414
commit bb3f361
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
7 changes: 5 additions & 2 deletions
7
VRTRAKILL/VRTRAKILL/VRPlayer/VRCamera/Patches/FixCameraOnRespawn.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
using HarmonyLib; | ||
using System; | ||
using UnityEngine; | ||
|
||
namespace Plugin.VRTRAKILL.VRPlayer.VRCamera.Patches | ||
{ | ||
[HarmonyPatch(typeof(NewMovement))] internal class FixCameraOnRespawn | ||
{ | ||
[HarmonyPrefix] [HarmonyPatch(nameof(NewMovement.Respawn))] static void SetPlayerRotation(NewMovement __instance) | ||
{ | ||
// HOW :( | ||
CameraConverter.Container.transform.localPosition = Vector3.zero; | ||
CameraConverter.Container.transform.localRotation = Vars.MainCamera.transform.rotation; | ||
|
||
__instance.transform.localRotation = CameraConverter.Container.transform.localRotation; | ||
} | ||
} | ||
} |