Abdul Mukheem Shaik d540ec8a68 Fixing the camera movement in progress. Not resolved yet
Co-Authored-By: MinaMaddahi <145911367+MinaMaddahi@users.noreply.github.com>
2024-11-15 19:55:46 +01:00

28 lines
780 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Varjo.XR;
public class CameraPosition : MonoBehaviour
{
// Variable to store the locked Y position
private float lockedY;
// Start is called before the first frame update
void Start()
{
// Save the initial Y position as the locked position
lockedY = transform.position.y;
VarjoMixedReality.LockCameraConfig();
}
// Update is called once per frame
void LateUpdate()
{
// Get the current position of the camera
Vector3 currentPosition = transform.position;
// Lock the Y position while allowing X and Z to update
transform.position = new Vector3(currentPosition.x, lockedY, currentPosition.z);
}
}