These forums are CLOSED. Please visit the new forums HERE
Tracking Mouse Button Held |
|
Valence Sojourner
Junior Member
Join date: 1 Aug 2004
Posts: 2
|
08-04-2004 08:41
How do I make a gun call a function repeatedly as long as a mouse button is held? I am trying to create a gun with auto-fire, so I want it to call the 'fire' function repeatedly or peroidically as long as the user is holding down the left mouse button and stop when they let go.
|
Goshua Lament
Registered User
![]() Join date: 25 Dec 2003
Posts: 703
|
08-04-2004 08:45
I've seen this done before. I have a public domain script that I'l post a snippet of here. I'll do it when i login.
_____________________
Flickr Second Life Photo Gallery
I no longer regularly login to SecondLife, but please contact me if an issue arises that needs my attention. |
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
08-04-2004 12:45
One way I know of of doing something like this is via use of a timer event and a control event.
CODE
I hope my bit math is right. ==Chris |
Valence Sojourner
Junior Member
Join date: 1 Aug 2004
Posts: 2
|
08-04-2004 15:55
Thank you for posting your code. After analyzing it, I realized I could make a gun automatic with only a small change to the pop-gun code:
CODE
I don't think any extra variables are necessary. Delay can be added by setting a timer event in fire() that unlocks a boolean that supresses fire(). |