Skip to content

Instantly share code, notes, and snippets.

@abdullah353
Created October 16, 2014 19:18
Show Gist options
  • Select an option

  • Save abdullah353/06a96be6e4c9493b73f3 to your computer and use it in GitHub Desktop.

Select an option

Save abdullah353/06a96be6e4c9493b73f3 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class Follow : MonoBehaviour {
Transform target; //the target to follow
Vector3 offset = Vector3.zero; //the amount to be offset by 
void Update() {
if(target) transform.position = target.position + offset;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment