tower-traverse/Assets/Scripts/MinimapHandler.cs

19 lines
653 B
C#
Raw Permalink Normal View History

2025-03-30 01:20:08 +07:00
using UnityEngine;
public class MinimapHandler : MonoBehaviour
{
[SerializeField] private GameObject MainCamera;
// Update is called once per frame
void LateUpdate()
{
transform.position = new Vector3(MainCamera.transform.position.x, 40, MainCamera.transform.position.z);
// Get the Euler angles from the MainCamera's rotation
Vector3 mainCameraEulerAngles = MainCamera.transform.eulerAngles;
// Create a new rotation using the MainCamera's x and y rotation, but with your desired z rotation
transform.rotation = Quaternion.Euler(90, mainCameraEulerAngles.y, mainCameraEulerAngles.z);
}
}