Hello. I know that update() runs every frame, but is there a significant decrease in performance when an if() statement runs inside an update as well?
For example, if I have a boolean that controls whether the player can move and shoot:
function Update() {
if(canMoveNShoot) {
WASD = moving;
Click&Clack = shooting;
}
}
Is this the right way of enabling/disabling stuff, or is there another, better way?