GameObject will not rotate around its local y-axis in editor

I have an imported 3d model.
When importing the model, the transform rotation is (-90,0,0).
In the inspector, I cannot rotate this item around its local y-axis.
When changing the y euler angles, it proceedes to rotate around its local z-axis, instead of the y-axis.


Original imported rotation. I’m in Local mode. The green arrow is its y-axis, right?

Changing the y euler angles results in it rotating around its z-axis. Blue arrow?

No matter what euler angles I change, it will not rotate around the local green axis.

So does anyone know what might be going on here?

I’m at a complete loss here.
I’m running the code:

Update()
{
leftFang.transform.Rotate(new Vector3(0f, 1.0f, 0f), Space.Self);
}

In the editor, the x-euler angles are changing when running the code, not the y euler angles.

Try rotation your gameobject using this code:

leftFang.transform.rotation = Quaternion.AngleAxis(30, Vector3.up) * leftFang.transform.rotation;

that should rotate leftFang 30 degrees around his local Y axis (Green arrow)

This is very easy to reproduce. I have the following hierarchy:

Parent
…Cube

The parent has rotation of 0,0,0
The cube has localRotation of -90,0,0

I cannot get the cube to rotate around it’s green axis in the inspector. Changing the y-euler angles causes the cube to rotate around the blue axis.

Someone else try this out to see what I mean.

Parent at 0,0,0 rotation


j

Child at -90,0,0 rotation

Is not rotating around green axis

I am surprised this had never happened to me, I reproduced this behaviour and it’s happening because of Gimbal lock in the inspector (If you want to know more about gimbal lock do it here

)

This piece of code will rotate your object in the local Y axis:

leftFang.transform.Rotate(0, 30, 0, Space.Self);