Created
January 24, 2016 05:33
-
-
Save moon-goon/c1e8ab5e18b2ee2fdbc9 to your computer and use it in GitHub Desktop.
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
public GameObject targetObj; | |
private Vector3 offsetValue; | |
void Start() { | |
offsetValue = transform.position - targetObj.transform.position; | |
} | |
void Update() { | |
transform.position = targetObj.transform.position + offsetValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment