hey! out of curiosity, why are you using a const for clamping camera zoom?
Whenever you have a fixed value, one that won’t change during the course of the game and that is defined in the code, it is best practice to declare that value as a const. This allows the compiler to inject the actual value into the intermediate (compiled) code, which is faster than looking the code up from a variable location (usually the heap).
If a value never changes then you should use a const, in this case I wanted a fixed min and max so a const makes sense.
But if you’d like the camera zoom to have different settings, maybe one scene zooms in further than another scene, then you can easily change that to not be a constant and be regular changeable fields instead.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.