having to much ifs bad for performence ?

Does if () statements have influence on performence and is it beter to have a few huge codes or many litle ones i know that puting stuff in update is bad but if i make voids whit if statements in it and put those voids in update will it still decrease performence

First of all… punctuation is your friend. It’s difficult to figure out what you’re trying to say.

Putting stuff in Update isn’t “bad”, unless it’s something that doesn’t need to be called every frame, like initialization.

If you have some code that runs directly in Update() vs. code that runs in a function that Update() calls, that will hav identical performance costs.

The if in itself won’t hurt your performance in any way, though what you put inside the if statement still has to be executed of course.

That said, I’m pretty certain that you’re worrying about nanoseconds here. Nothing you’ve mentioned will have any appreciable effect on the performance of your game. In other words…

2 Likes

thank you for this answer and sorry for my english it aint my first languade :slight_smile:

It’s good practice to avoid branching in shader code. That’s code that gets executed thousands of times per frame.

In Update you won’t see a quantifiable difference.