Game Development Community

Mouse button pressed

by Alejandro Lopez · in General Discussion · 06/06/2008 (3:05 pm) · 1 replies

How can i now if the mouse button is still press ?
or , what function of the script are always called, like the loop game ?

#1
06/09/2008 (7:12 am)
You can ask the player if they're holding the trigger:

Assuming %player is the client's player
if (%player.getImageTrigger($WeaponSlot)){
   // primary trigger is down
   ...
}

If you can't do this you could try something creative with $mvTriggerCount0. Assuming you haven't rewired any of the mouse system, $mvTriggerCount0 should be odd when the left mouse button is down and even when it's up. This one is a bit more hacky so you might want to be careful.