ishmaru Registered User |
Quote
|
2017-07-15 16:53:23 |
|
Just wondering if anyone has a good solution for adding a jumping sound effect when a player jumps/ lands?
Just doing it by keypress alone will trigger multiple repetitive sounds which is not what anyone would want.
|
3dblendsphinx Registered User |
Quote
|
2017-07-15 19:34:26 |
|
Best thing is to have a variable for the state of the sound. So let's say you declare jumpisPlaying=0/1 with 0 being false and 1 being true. So on the key press check jumpisPlaying to make sure it isn't already playing if it isn't then set the jumpisPlaying to 1/true and play the sound. When the person lands it stops the jump sound and set the variable jumpisPlaying to 0/false.
|