CarmenSandiego/Assets/UdonSharp/Cameras/CameraAutoLevel.cs
Jamie Greunbaum 5bb080d546 - Removed final remnants of LightSync from the project.
- Fixed jail chain potentially calling a GameManager function on all clients.
2026-06-05 15:02:18 -04:00

25 lines
557 B
C#

using UdonSharp;
using UnityEngine;
using VRC.SDK3.Components;
using VRC.SDKBase;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class CameraAutoLevel : UdonSharpBehaviour
{
[SerializeField] private VRCObjectSync _Camera;
public override void Interact()
{
if (Utilities.IsValid(_Camera))
{
Transform TeleportLocation = _Camera.transform;
Vector3 oldRotation = TeleportLocation.eulerAngles;
TeleportLocation.eulerAngles = new Vector3(oldRotation.x, oldRotation.y, 0.0f);
_Camera.TeleportTo(TeleportLocation);
}
}
}