- Home /
Trying to rotate a tower after instantiate
What I am trying to do here is I want to rotate my tower 90 degrees on the x axis after I create the object in game. I have the prefab set to 90 degrees but when I start the game and place my first tower, it resets everything back to 0. This is my instantiate code. please let me know what I can do. Thank you
Instantiate(towerPrefab, transform.position, Quaternion.identity);
Answer by meat5000 · Oct 09, 2013 at 06:53 PM
http://docs.unity3d.com/Documentation/ScriptReference/Transform.Rotate.html
Or just add a rotation in inspector after clicking the object in the hierarchy.
Answer by EOTS · Oct 09, 2013 at 07:07 PM
Thank you,
I was actually able to figure it out like 2 minuets after I posted this. I just made a small change in the Quaternion
Instantiate(towerPrefab, transform.position, Quaternion.AngleAxis(90, Vector3.left));
I love how I spent forever trying to figure this out and after I post this question I was able to answer it myself lol.
Thank you for taking the time to help me.