Optimization and Trivial Methods

Watched a really excellent GDC video on Mobile optimization strategies. One thing mentioned was to avoid ‘trivial’ methods, Quaternion.Set, Vector3.scale and Transform.Trnslate, Transform.Rotate, especially in update method.

I always use Transform.Translate and Transform. Rotate. Can anyone suggest what I would use or give a actual code example instead to change a gameobject’s position or rotation directly?

It doesn’t get much more direct than:

transform.localRotation = Quaternion.AngleAxis(whatever);
transform.localPosition = new Vector3(1,2,3);

Using “local” means it doesn’t have to crawl up the chain of parents to work out its true position, and local coordinates are how the position is stored internally. Hence, setting or getting transform.position can be considerably slower than transform.localPosition.

That said, could you link the video in question? The claim sounds a little suspect to me.