Created
October 16, 2014 19:18
-
-
Save abdullah353/06a96be6e4c9493b73f3 to your computer and use it in GitHub Desktop.
Follow Script
From http://answers.unity3d.com/questions/31949/position-a-circle-under-my-character.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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