Transform.Rotate not working properly

I am running

private void Update()
{
    transform.Rotate(Vector3.up, 90, Space.Self);
}

on a game object.

If I put this script on a “simple” mesh object it works as expected (for each Frame, the object is rotated by 90 degrees). However, if I put this script on an “empty game object” (that contains “real” objects as children), the children do not rotate. Why is this?


More info:

  • The children do not have any script/animation/… attached, they are simple mesh objects with a renderer and a collider.
  • The same approach fails with various other methods to rotate the object as well, including transform.rotation = ..., transform.localRotation = ... and other overloads of the Rotate-Method.
  • If I create a new Empty GameObject, add the script to it, create another new Empty GameObject as a child and add a mesh to it, the very same thing happens, so re-creation of the tree does not help.

I guess I do overlook something very simple here, but I cannot figure out what it is.

Have you tried Quaternion.Euler*?

`

Transform tr;

void Awake ()
{
     tr = transform;
}

 private void Update()
 {
     tr.rotation = Quaternion.Euler(0, 90, 0);
 }

`

I have used transform.eulerangles w/ children attached and it worked as expected. Maybe try that?

Strange thing: as soon as I rename the parent object, it works again.

I hope my Problem is thereby solved, still I’d be interested in an explanation why this can happen at all and if this is correct behaviour.