isMouseDown Broken

The variable isMouseDown in the Wick Editor 1.0 Alpha is broken, for me at least. I have a very simple code snippet, which I will share with you now.

if(isMouseDown)
{
   playSound("shot.wav");
}

This is placed within an update script, it is described as being true whenever the mouse is down. The audio will play every frame. I don’t have to even touch my mouse, it will play every frame. When put in a default script, it will play once and never again.

I suspect that isMouseDown is always true, as displayed by this code snippet, which is never called.

if(!isMouseDown)
{
    playSound("shot.wav");
}

If this is a bug, is there another way to detect the mouse being down at any position? If it isn’t please tell me what I’m doing wrong, thanks.

Just tested this and it seems your right, isMouseDown is currently broken. I’ll get on fixing it.

In the mean time, you can add an interactive object that covers the screen and has a mousePressed or mouseDown event. These should work properly.

1 Like

Ok, a fix for isMouseDown was pushed.

Turns out, the snippet in the interactive reference was incorrect. Is you use isMouseDown(), it will work!