Some questions about rotation

Hello everyone!

I’m making a FPS, and I’ve added a minimap taken from the asset store (MiniMap (Radar) System | 3D Characters | Unity Asset Store)

Everything is working fine, except for the rotation: instead of rotating on its Z axis to match the player rotation, the whole thing rotates on X,Y and Z. eventhough the code clearly specify a rotation only on Z.

if (rotateMap)
{
mapRect.rotation = Quaternion.Euler(new Vector3(0,0, playerTransform.eulerAngles.y));
//mapRect.Rotate(new Vector3(0, 0, playerTransform.eulerAngles.y));
mapArrow.rotate(Quaternion.identity);
}

The commented part (mapRect.Rotate(new Vector3(0, 0, playerTransform.eulerAngles.y)):wink: does indeed rotate the map only on Z (but obviously keeps rotating it) but mapRect.rotation = Quaternion.Euler(new Vector3(0,0, playerTransform.eulerAngles.y)); rotates the map on the 3 axis.

I’m sure it’s something very simple that I’m missing but I can’t seem to be able to figure it out: I would appreciate any help I can get.

You could try playerTransform.localEulerAngles.y