I have a script that runs every frame.
In 2 spots I want to test player.IsSneaking.
Is it more efficient to set a variable with the result of player.IsSneaking, then test against that variable, or to just use player.IsSneaking twice?
What matters is how trivial (or not) the IsSneaking function is; a very simple memory read would outperform a memory write (setting the variable).
But since I don't know how trivial it is, I'm here to ask; does anyone know?
For that matter, does anyone know which functions are cheaper than writing to a variable?
Queue
