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 theRotate
-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.