How to Disable/Enable Mouse

  • How to Disable/Enable Mouse?

    I want to built shooting game, when my ammo = 0, I need to disable mouse and after reload enable.

  • Hi, welcome to the forum.

    There are lots of ways. Did you think of any ideas?

    A couple of ways..

    You can have a variable MouseEnabled which can be 1 for mouse enabled or 0 for mouse disabled. Set it to 0 when ammo=0 and 1 after reload. On your mouse events, also have the condition that this variable = 1

    or

    Have the mouse events in a group, and disable the group when ammo=0; enable it after reload.

    Be sure to search forum and tutorials. For sure you will find something.

  • What would you like to disable about the mouse?

    Do you mean disable the events regarding to mouse input?

    There are many ways this can be done, but the easiest way would be to create a global variable, you could call it IsReloading and add a condition to all events regarding mouse input that they only work if IsReloading is 0 and set that variable to 1 while reloading..

    After reload is finished set the variable back to 0 and the mouse input will be enabled again..

    Ninjaad by

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can't disable the mouse plugin, but you can disable the mouse group and after load enable it.

    The best way is to make load variable like this :

  • Thank You Very Much!

    Now I understand.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)