Heya! I'm having another problem with the plugin I'm writing haha.
So... so far, everything works. But the current problem is that it's working every single frame - which of course causes massive lag. It's supposed to only run the main function if touch input is triggered, but when I open the console I can see it's constantly running everything over and over again (I can tell by console.log() checks I dispersed throughout the main function).
So I added a console.log() check to the part that checks for touch input and... well, apparently it thinks there's always touch input triggered, even when I haven't clicked a singe thing.
Does anyone have any clue why this might be happening?? Could my testing on a laptop with a touchscreen have anything to do with it (and no, nothing is physically touching the screen either)?
Thanks in advance, as always!
So... so far, everything works. But the current problem is that it's working every single frame - which of course causes massive lag. It's supposed to only run the main function if touch input is triggered, but when I open the console I can see it's constantly running everything over and over again (I can tell by console.log() checks I dispersed throughout the main function).
So I added a console.log() check to the part that checks for touch input and... well, apparently it thinks there's always touch input triggered, even when I haven't clicked a singe thing.
Does anyone have any clue why this might be happening?? Could my testing on a laptop with a touchscreen have anything to do with it (and no, nothing is physically touching the screen either)?
Thanks in advance, as always!
Code:
$.Scene_Map_updateScene = Scene_Map.prototype.updateScene;
Scene_Map.prototype.updateScene = function() {
$.Scene_Map_updateScene.call(this);
if (!SceneManager.isSceneChanging()) {
if (TouchInput.isTriggered) {
console.log('input triggered');
this.checkClickableEvents();
} else {
console.log('no input');
}
}
};