Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi! I'm wanting to create the car sound while accelerating with the button of keyboard, however, the sound has a loop repeating endlessly, getting really ugly, it's probably because the accelerator key comand is being pressed, which is the same command as "action execute a sound". How do I make the car sound play only once while accelerating the car? It is possible to do without javascript code? Thank you! |
||||
|
Hello devs! So my question is: how do you play a sound and have it play in its entirety once, even if the player keeps pressing the command key, like when accelerating a car? |
||||
|
It's because windows repeats keypresses which is triggering multiple sounds. To prevent that, either turn off key-repeat in your windows settings or use variable in coppercube. EG: When key is pressed, if variable "EngineSND" <>1, Play "engine.wav" looped. Set Variable "EngineSND" =1 When key is released, Stop Sound "engine.wav". Set Variable "EngineSND" =0 |
||||
|
Thanks! It's a good idea! |
|