Performance wise, does it matter?

Wouldn’t it be better performance wise to set the emission of particles only once with Input.is_action_just_pressed(), rather than Input.is_action_pressed() like in the video?

In isolation, absolutely.

In the context of where these particles are used, Bram is just reusing the input that already exists for controlling the rocket, and if you try to use Input.is_action_just_pressed() in this case, that rocket isn’t going anywhere.

You could implement a similar idea here, but because it would still involve checking the status of emitting each frame anyway, you probably wouldn’t save much. Still, keep thinking along these lines; it’s a great habit to be in, and there are definitely other, much better opportunities for optimization in this course!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms