FollowTarget.cs 342 B

123456789101112131415161718
  1. using System;
  2. using UnityEngine;
  3. namespace UnityStandardAssets.Utility
  4. {
  5. public class FollowTarget : MonoBehaviour
  6. {
  7. public Transform target;
  8. public Vector3 offset = new Vector3(0f, 7.5f, 0f);
  9. private void LateUpdate()
  10. {
  11. transform.position = target.position + offset;
  12. }
  13. }
  14. }