[SOLVED] Continuous Firing Problem

I want to get my player to shoot bullets continuously, but I can’t add anything to the scene hierarchy inside a setInterval function.

Create timer variable in init function.

In update function increase it. And check, is it equal to, for example, 1000. If is, make shoot and reset your counter.

Shootstuff.prototype.initialize = function() {
    this.timer = 0;
Shootstuff.prototype.update = function(dt) {
    this.timer +=dt;
    if (this.timer >=1000) { 
          this.timer = 0; 

And sure, you need shoot function.

Fixed it. Thanks for the help!