Okay, I have a wav file. It is suppose to be an attacking sound effect for an enemy in my game. I’m trying to play it when the enemy’s attacking animation reaches a certain frame. I have the logic bricks set like this:
But it doesn’t play the sound, though I hear like tiny pops on my speakers. The sound only plays with the always sensor. I also tried connecting an always sensor, but it it still won’t play at the frame and will only play once. How do I get it to play at a certain frame?
Interval should work. The reason it is stopping is that the sensor is no longer true - i.e. attackframe is no longer equal 12. There are other options, depending on your details - for example, on the start case you could also set a property and OR that property into the controller, so that once started, it keeps going (until whatever other controller it is you have stopping it activates). Generally I try to avoid complicated logic bricks like that though - at some point it’s cleaner to write 2-3 lines of Python instead.