summaryrefslogtreecommitdiff
path: root/GameCode/FollowTransform.cs
blob: 32c0671ca62fb7418e734bb418a9847fad0546c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using UnityEngine;

public class FollowTransform : MonoBehaviour
{
	public Transform target;

	private Vector3 spawnOffset;

	public Vector3 offset;

	private void Start()
	{
		spawnOffset = base.transform.position - target.position;
	}

	private void LateUpdate()
	{
		if ((bool)target)
		{
			base.transform.position = target.position + spawnOffset + offset;
		}
	}
}