I’ve been trying to optimize my iOS game as much as possible.
I’ve gotten into the habit of always caching transforms so that I’m never calling “.transform” or “transform.[whatever]” in an Update function. Instead, I assign the transform to a variable in the script’s Awake or Start functions and just call that variable in the Update functions.
Should I be doing the same for other components? Like…rigidbody, or animation? Or is transform the only one that can slow things down?
And what kind of speed increase should I even expect while doing this? I haven’t been able to really quantify how fast caching the transform component is. Does it really make a big difference?