Instantiated Object Settings

I’m building a top down shooter. I have a prefab with the following rotation settings;
X = 90 Y = 0 Z = 0.

When I drag the prefab as an independent object onto the hierarchy, the object is facing perpendicular to the camera. It appears flat and fully visible.

However, when I use the following code to create an object: Instantiate(Myobject, rigidbody.position, Quaternion.Identity), the object rotates -90 degrees, facing directly at the camera, effectively, with an Rotation of 0 in the X field.

Does anyone why this is happening? I have not written any other code to change the objects rotation so I figured it would use the settings of the prefab.


If you instantiate with Quaternion.Identity, it will automatically align to axes as the documentation said: Unity - Scripting API: Quaternion.identity

So try this:

Instantiate (object, position, Quaternion.Euler(90, 0, 0));