P
Pitu
Guest
Hey so I'm having some trouble with playing sounds, When the player walks i want the aud_walking sound to play, but what happens is that when it is in the step event (at least I THINK it's because it's in the step event) the sounds keeps overlapping on its self (tried playing with loop variable setting to true and false) but nothing helps? How would i implement this?
"hspd" is the variables that determine if the player is gaining horizontal speed in each direction so like if he is walking to the left the hspd will be in negative and if right it will be positive
this code is placed in the step event (NOTE: I also tried to give it conditionals but that didnt help either like sound_is_playing = false etc..), I really dont want to use the keyboard events so please help me implement it somehow, the sound doesn't even play in the create event btw
Code:
if(hspd > 0){
audio_play_sound(aud_walking, 1, true);
} else if(hspd < 0){
audio_play_sound(aud_walking, 1, true);
} else{
audio_stop_sound(aud_walking);
}
this code is placed in the step event (NOTE: I also tried to give it conditionals but that didnt help either like sound_is_playing = false etc..), I really dont want to use the keyboard events so please help me implement it somehow, the sound doesn't even play in the create event btw