Files
HauntedBloodlines/Assets/Scripts/RotateObject.cs
2025-05-29 22:31:40 +03:00

27 lines
574 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotateObject : MonoBehaviour
{
[SerializeField] private Transform _object;
public float XRot;
public float YRot;
public float ZRot;
Vector3 NewRot;
private void Awake()
{
if(_object == null)
{
_object = GetComponent<Transform>();
}
}
public void RotateThisObject()
{
_object.transform.localRotation = Quaternion.Euler(_object.localEulerAngles.x, YRot, _object.localEulerAngles.z);
}
}