using System.Collections; using System.Collections.Generic; using UnityEngine; public class FollowYRotation : MonoBehaviour { public Transform target; void Update() { if (target != null) transform.eulerAngles = new Vector3(0 ,target.eulerAngles.y, 0); } }