18 lines
653 B
C#
18 lines
653 B
C#
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);
|
|
}
|
|
}
|