Instantiate objects with a 0,0,0, rotation?

Hi,

I am a bit stuck with how to write a line of C# code…

The following is the “setup” for the gameobject in the scene I am working on.

  1. I have a spawned #1gameobject that follows a path.

  2. This #1gameobject hits a trigger which Instantiates a new #2Gameobject that falls to the ground using a Rigidbody. This #2Gameobject rotates as it falls.

  3. The groundplane has a collider that acts as a trigger to Instantiate smaller #3Gameobjects when the falling #2Gameobject hits it.

  4. These smaller #3Gameobjects beeline to a target at the center of the ground.

The above all works well, with one problem… I need the #3Gameobjects to Instantiate with a 0,0,0 rotation. I am fairly certain that my Instantiate line of code needs to state a 0,0,0, but am not sure of how to state it.

I’m really new to coding, so if anyone can provide some help I’d appreciate it… or point out a good place to look for syntax and examples so that I might be able to figure out the answer myself.

Thanks ahead of time, I appreciate it!
-Kory

GameObject goTroop = (GameObject)Instantiate(enemyTroop, transform.position, transform.rotation);

Check : Unity - Scripting API: Quaternion.identity

    GameObject goTroop = (GameObject)Instantiate(enemyTroop, transform.position, Quaternion.identity);
1 Like

Thanks mgear!! I actually just found the doc and found that to be what I needed to say to make it work! I appreciate you chiming in to help!