Cannot rotate object and keep it facing camera

object type: plane (non-prefab)

code:

public float rotationSpeed;
private Vector3 euler;

// Use this for initialization
void Start ()
{
rotationSpeed = 60;
euler = transform.eulerAngles;
}

// Update is called once per frame
void Update ()
{
//rotate mathematically about axis:
euler.z = ( euler.z + rotationSpeed * Time.deltaTime ) % 360;
//update object rotation:
//transform.EulerAngles = euler;
transform.localEulerAngles = euler;
}

whether i do x y or z it will still rotate in out of visibility.

the local object axis that faces the camera is Z but that axis rotates exactly the same as Y.

Ideas?

somewhat kind of answered my own question…I compared rotations between planes and objects and ALL planes rotate the Z-axis the same as the Y-axis; however any other object (cube, sphere etc.) rotates correctly.
I guess Unity did not give planes a z-axis?
If someone could confirm my findings that would be awesome.

Rotations can be a bit tricky when you’re trying to control them with euler angles, as they’re actually Quaternions. It’s best to keep them as Quaternions or you can end up with some funny business as you’ve found out.