i noticed alot of scripters would put
Awake () { private Transform myTransform = transform; }
would someone be kind enough to explain whats the benefit from this?
thanks.
i noticed alot of scripters would put
Awake () { private Transform myTransform = transform; }
would someone be kind enough to explain whats the benefit from this?
thanks.
I believe the use of it is to save processing cycles.
You are caching the transform saving your computer the trouble of finding the transform every frame.
This will increase the memory though, but only with a unnoticeable amount.
In short; it makes it go a lot faster, I think.
This method is apart of performance optimization, this page mentions this method and other types of performance saves you can make in order for your game to run better, smoother and faster.