How to rotate an instantiated object by a fixed amount before it is spawned

Hi all, I am trying to rotate my instantiated object so it is facing away from my spawner as it is currently facing into the Z axis rather than the X. I have tried:

missile.transform.Rotate (0,rotation * Time.deltaTime,0);

but this doesnt seem to work.

I have also tried re-setting the missile prefab to its original coordinates of 0,0,0 and nothing happened.

Finally I tried setting the missiles rotation to as it should be in the preview window and creating a new prefab with it.

Can anyone tell me how to reference the instantiated object (as I think that i may be referencing the parent object by mistake.) Otherwise can someone please shed some light on this?


Again I have fixed it immediately after posting. Oops. I used this:

function Start() { transform.Rotate(0,90,0); } on the missile itself to rotate it as a one time thing before it spawns. Thanks

The Instantiate method has an override which accepts an initial position and rotation as well as the object to instantiate. Using this you can place and rotate the object while you're spawning it so you don't have to update it later.