How do I change the rotation of a model?

OK. This is noobish, I’m sure, but I’m a programmer, not a modeller, so I really don’t yet know what I’m doing. I’m using Blender and I’ve made a model that is a capsule - a cylinder with spherical ends. It seems to import into Unity just fine, but when I Instantiate an object that uses this mesh, I get it oriented so that I am looking down on one end and it just looks like a sphere. I need to have it oriented so that I see it lengthwise.

Now yes, I could change the transform to rotate it, but that’s hackish since I would have to do it every single time I Instantiate the object. Instead I just want it’s default orientation to be correct. I’ve tried rotating the model in Blender and reimporting it, but nothing I do has any effect!

How can I get this thing properly oriented by default?

You can walk around this problem. Just make prefab with imported mesh, change rotation in prefab, and instantiate the prefab, not the imported mesh.

If you don’t want to walk around. Check out options when you export from Blender, maybe this will help.
2809962--204210--axis.png

What do you mean, “export”? Doesn’t Unity know how to read .blend files? The only other mesh I made in Blender works just fine.

And I already am using a prefab. The problem is that when you call Instantiate() it sets the rotation explicitly, overriding what’s in the prefab.

OK. I can make it work right if I explicitly set the rotation to the prefab’s stored rotation, but I still find it hackish that I have to do this.

public class Brick : MonoBehaviour {

    public GameObject power_up;
...
    void spawn_power_up() {
        Instantiate( power_up, transform.position, power_up.transform.rotation );
    }
}
1 Like

It’s not “hackish” at all. I would say it’s normal using, but I understand that you feel weird, that some objects doesn’t need this to instantiate properly.

About “export”, I mean - yea, Unity does read .blend files. I just say that you may check out how is it going if you export your mesh to .fbx, is the problem still occures, so you can know is this a problem in Unity, or is this a problem with .blend file.

Rigged models should come up correctly in Unity.

For static models, in Blender, give the model an unbaked X axis rotation of 90 degrees (in short, enter edit mode on your objects, rotate everything on X by -90 degrees, leave edit mode, rotate on X by +90 degrees)

In case you’re not that familiar with Blender:

  • If your object has arbitrary rotations, bake them (Ctrl+A)

  • Put the 3D cursor at {0, 0, 0} (press N key while inside 3D viewport to enter 3D cursor coordinates)

  • Set rotate around cursor mode (Period key)

  • Select mesh and enter edit mode (Tab key)

  • Select all (A key, press again if everything was already selected)

  • Type “R X - 9 0” (rotate on X axis by -90 degrees)

  • Leave edit mode (Tab key)

  • Type “R X 9 0” (rotate on X axis by +90 degrees)

1 Like

Oh. Rotate while in edit mode. I guess there’s a difference between rotating the object and rotating the individual vertices. Something to remember.