find angle between gameobject and world axis?

this didn’t work and i dont know why:"

Vector3.Angle(go.transform.eulerAngles ,transform.forward);

the result stays stuck at 90 for any go.rotation

eulerAngles is not a directional vector, so this won’t work. Vector3.Angle is used to find an angle between two directional vectors, i.e. vectors that when normalized would point in the direction something is facing. The vectors don’t necessarily have to be connected in any way, but usually it makes more sense to consider at least one of the ends points to reside at the same position. There are cases where you might just want the angular difference between two headings of two different objects.

I’m not sure exactly what you mean by finding the angle between the game object and the world axis. If you mean finding the game object’s angle relative to the world axis, that’s just eulerAngles. If you wanted the game object’s angles relative to its parent, it would be localEulerAngles.

You wrote world axis. So don’t you think the equation should have that? For example, X is Vector3.right (or new Vector3(50,0,0), etc… anything with positive X and 0 for Y and Z.)

transform.forward is the direction the object is facing (the blue arrow, which is where it “counts as” facing. If it isn’t, most people fix it.)

So, to get the angle between object facing and right facing, use Vector3.Angle(transform.forward, Vector3.right). The angle is if you put the starting ends of both arrows together. 0 means you’re facing right. 10 means you facing almost right – titled 10 degrees up or down from that. If you need to know which one (often you don’t) you can search around here for that trick. It’s also 3D, so 10 could mean you’re looking mostly right, but 10 degrees up.