LookAt Instantiated Object

How do I use LookAt with a newly instantiated object?
I thought it should be something like:


But it didn`t work.
What am I doing wrong?
(PS I am very new to JavaScript and dumb as well, so please try to advise the simpliest solution ever).

Right after you create your new object execute your lookat method.

function Creation()
var clone:GameObject = Instantiate(obj,transform.position,transform.rotation);

An important thing for you to note is lookat only Takes transforms. So what you are doing is kind of correct at the end you could just end .transform and as long as that object exists you will be good to go.


If you want to continue a little more investigation