Can not rotate immediatly after instantiation

Hi Guys,

I am trying to rotate an instantiated object immediately after i create the object, but it doesnt seem to work. I am doing the following

var spawnedGameObj : GameObject=Instantiate (spawnGameObject, Vector3.zero, Quaternion.identity) as GameObject;
spawnedGameObj.transform.eulerAngles = Vector3(10.0, 120.0, 0.0);

It does work however if I put do just
var spawnedGameObj : GameObject=Instantiate (spawnGameObject, Vector3.zero, Quaternion.Euler(10, 120.0, 0.0)) as GameObject;

The way my code is though, it is cleaner to break it up into separate calls.

Any idea why this doesnt work?

Nevermind. It was my fault. There was a race condition with a script that was instantiated along with the gameobj that was overriding what I was setting.