Skip to content

Instantly share code, notes, and snippets.

@tracend
Created March 29, 2011 23:16
Show Gist options
  • Save tracend/893550 to your computer and use it in GitHub Desktop.
Save tracend/893550 to your computer and use it in GitHub Desktop.
Unity3D: A simple script that looks at the target transform - Source: http://wiki.dreamsteep.com/Unity3d
// Make the script also execute in edit mode.
@script ExecuteInEditMode()
// Just a simple script that looks at the target transform.
var target : Transform;
function Update () {
if (target)
transform.LookAt(target);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment