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(); } } public void RotateThisObject() { _object.transform.localRotation = Quaternion.Euler(_object.localEulerAngles.x, YRot, _object.localEulerAngles.z); } }