|
I am following a simple tutorial to learn Unity- in the tutorial, I am attempting to make a turret who's head always rotates to follow the player's location. The script is the one from the Unity Script Reference: var target : Transform; function Update() { transform.LookAt(target); } This script is used in the tutorial, and works great for them. But, when I use it (or the SmoothLookAt script that comes with Unity), applying it to the part I want to rotate (the turret head) and targeting my character (the worm), the turret head flies off to a seemingly random location and orbits around my character as I move it. Any ideas? For reference, the tutorial I am following can be found here: http://www.youtube.com/watch?v=u8t3fdKhDxg&feature=relmfu and the relevant script and application are at 7 minutes in. Any help would be greatly appreciated!
(comments are locked)
|
