this is actually a general question in the sense that if i have a script for movement for example which is obviously a script that will use the transform/rigidbody components of the object there attached to.
is it worthwhile to do
movement_transform = transform;
then later do
transform.forward just as fast?
it seems like finding the attached component MIGHT be an intensive process for unity (it seems a bit odd if so, i’d have imagine it’d almost just be a saved memory address, in which case it would be only VERY VERY slightly faster to go straight to it than grab the memory address first).
The thing is when i used a for loop to get something it appeared saving it and accessing it was ALOT faster than the alternative.
Based on that i’m actually fairly sure it is faster but if you know i’d also like to know why. Is retrieving the memory address really that intensive?