hey guys I’m new to unity 3d and to its community
so HELLO
so i was reading tutorial about JavaScript doing some minor things
and while I was reading this
http://download.unity3d.com/support/Tutorials/2%20-%20Scripting%20Tutorial.pdf
the part were you need to stick a spotlight to a object was broken or was I doing something wrong
var target : Transform;
function update(){
transform.LookAt(target);
}
and the spotlight didn’t follow the object and compiling didn’t show any errors
can anyone confirm this or its just my own mistake, and maybe there is up to date tutorial for unity 3d 3.0 ?
thanks for the help
Make sure that you have added the target in the inspector. In the default layout, that is the pane on the far right. When you select the spotlight, you should see that the script is attached to it. Make sure the target object is dragged into the slot that says target.
Use Update, not update.
–Eric
yeah thanks guys for the help, but I understand what was my problem it seems that, the script follows the camera it self not the target of the camera still thanks for helping