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