12 [SerializeField, Tooltip(
"The target to follow. Usually a vive tracker.")]
private Transform target =
null;
13 [SerializeField, Tooltip(
"The offset vector from the target position.")]
private Vector3 offset = Vector3.zero;
22 if (target ==
null)
return;
23 transform.position = target.position + offset;
26 public void SetTarget(Transform target,
bool withOffset)
30 Debug.Log(gameObject.name +
": FollowMotion has no target.");
34 offset = withOffset ? (transform.position - target.position) : Vector3.zero;
void SetTarget(Transform target)
void SetTarget(Transform target, bool withOffset)