Question on pointerdown

this.input.on(‘pointerdown’, function () { }; seems to send hundreds of clicks within small amounts of time. I suppose that isn’t a bad thing, it’s just part of the refresh rate, but how would I go about slowing the function down? I want the player to click and only send a click every second or so, not a couple at a time. Thanks.

pointerdown should fire exactly once per press.

Just a thought; do you have the ‘…input.on…’ line within an ‘update’ method?

I believe that line should execute once, so it should go in a constructor or a ‘create’ method.

Good point. It is in the create() method.

If you’d be willing to upload your code somewhere, I’d be happy to run it on my machine and see if I can figure out whats wrong.

As @Samme said, pointerdown should indeed only fire once per click :slight_smile:

Without further info on it, I might suggest adding a ‘console.log(“test”);’ line directly below the ‘this.input.on…’ line. Then you can check the browser console and be absolutely sure it’s running just once.

Yeah it was a matter of another function running rapidly. I added in some checks so that it only triggers once