the visual´s lua problem

uriel xd

Member
hi, I have a problem with a lua...
I'm looking for a way for the game to detect when someone holds down a button (for example, CUSTOM1), and automatically stop holding it.
For example, The custom button 1 is pressed and the player goes to the S_PLAY_FALL state, well, but if it is hold the button (cutom1), it stays in that state, instead of going to the next one, how do I fix that?
I'm sorry if the way I explained was very basic or confusing, I hope you understand.
thanks
 
Well, you can simply ignore the button press check if the player's already in the S_PLAY_FALL state.

Though if you're looking for a more general purpose solution, I've provided an answer to a similar problem here

It involves keeping a counter for when you're holding a button, and only executing on the first frame of you pressing it so that it does not repeatedly execute the code.
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top