0
\$\begingroup\$

When I add a Cube to a scene, the blue axis (=forward) of the cube points into a certain direction.

When I now change the Y rotation of the cube to 90 in the inspector, the blue arrow doesn't rotate.

I would have expected it to rotate with the rotation that I have defined for the cube.

What is happening here?

To explain more in detail why this is bothering / confusing me:

I want to rebuild the RE4 inventory (which is actual 3D). The items in this inventory can be moved within the "grid":

enter image description here

To do that I have created a suitcase and then I added a gun to it:

enter image description here

As one can see, I have assigned the facing direction properly: The blue axis (=forward) points into the direction of the gun.

Now I wanted to rotate the gun in such a way that it is shown like in the original RE4 inventory.

To do that, I apply a rotation of Y = -90.

The gun looks correctly now:

enter image description here

However, the blue axis now faces the wrong direction in my opinion. Why does it not rotate along with the rotation of the gameobject?

This really confuses me because now when I want to move the gun left or right, I have to change its X position value instead of changing the Z position value.

This just seems wrong to me.

Can somebody tell me what I'm missing here?

Thank you.

enter image description here

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

Looks like you have your Gizmo Display Toggles set to global mode instead of local.

You can find these in the toolbar here:

Screenshot from Unity documentation

When set to Local mode, the gizmo arrows / rings will match the object's local orientation.

When set to Global mode, they'll always match the world axes.

Your object and its local directions are still rotating either way, it's just the display of the gizmo that's affected.

\$\endgroup\$
3
  • \$\begingroup\$ Yes, that changes the Gizmos, thank you. But why do you say "local orientation / local direction"? The gameobject is rotated in world space, not only in local space. I just don't understand why the rotation doesn't automatically change the direction. \$\endgroup\$
    – tmighty
    Commented May 4, 2019 at 22:44
  • \$\begingroup\$ Unity advises to use "transform.Forward" to move the object with its blue Z axis. But I don't want to do that. I need to set both the vertical and horizontal position in order to position the weapon in the grid. To do that, I want to use a Vector2. Is that not possible? \$\endgroup\$
    – tmighty
    Commented May 4, 2019 at 23:19
  • \$\begingroup\$ I have added my own answer because yours didn't really explain the problem to me.. \$\endgroup\$
    – tmighty
    Commented May 5, 2019 at 16:06
0
\$\begingroup\$

I will try to answer my question. Please correct me if I'm wrong with anything!

To check what is going on here I did some experiments:

I created a cube in Blender and exported it with 2 different export settings:

1) "x is forward"

2) "-z is forward"

In the below screenshot it can be observed that this export option has absolutely no effect on the Unity axes. The red arrow always points sideways, the green arrow always points up, and the blue arrow always points forwards.

Even if the objects are rotated in Unity or in Blender, it has no effects on the Unity arrows. In fact, the arrows are more or less useless in my opinion and should ONLY be used to inspect LOCAL rotation values. For the "Global", the arrows seem to be confusing and also useless.

I have then imported a model which has the rotation set incorrectly in Blender. As one can see, this affects the rotation of the model, but not the Unity arrows:

enter image description here

For double-checking I created a scaled cube and exported it with different axes export settings. One can see that it affects the rotation of the model, but again not the Unity arrows:

enter image description here

So it's safe to say that one can never change the direction in which the X, Y and Z values move an object. One can only change the "local" rotation.

I'm not sure if that's a good explanation, but for me it was the only way to understand it.

Again, please anybody just correct me if he spots anything wrong in my explanation.

Thank you.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .