if(transform.up == Vector3.up) {
g.localRotation = Quaternion.Euler(new Vector3(0f, 90f * GD.rot, 0f));
} else if(transform.up == Vector3.down) {
g.localRotation = Quaternion.Euler(new Vector3(180f, 90f * GD.rot, 0f));
} else if(transform.up == Vector3.right) {
g.localRotation = Quaternion.Euler(new Vector3(90f * GD.rot, 0f, -90f));
} else if(transform.up == Vector3.left) {
g.localRotation = Quaternion.Euler(new Vector3(90f * GD.rot, 0f, 90f));
} else if(transform.up == Vector3.forward) {
g.localRotation = Quaternion.Euler(new Vector3(90f, 0f, 90f * GD.rot));
} else if(transform.up == Vector3.back) {
g.localRotation = Quaternion.Euler(new Vector3(-90f, 0f, 90f * GD.rot));
}
So, I want to rotate object g in the direction my object is pointing (one of 6 basic ones) with it’s “up”. At this point everything is fine. Also I want to rotate it around its local “y” (90f x GD.rot) and its still all fine with first 4 sections, but 5th and 6th works wrong. My 90f x GD.rot used in the “z” slot rotates the object around “y” axis instead of “z” (“y” is also rotating it around “y”) and Im really confused whats wrong, maybe its a 5.4b problem, or something?