using UnityEngine; public class FollowTransform : MonoBehaviour { public Transform targetTransform; public bool faceForward; private void Update() { if (targetTransform != null) { base.transform.position = targetTransform.position; if (faceForward) { base.transform.forward = targetTransform.forward; } } } }