Hi all,
I modified the simple_event.cpp provided with the API examples solution, here the change:
//... same as before (simple_event.cpp)....
//explosion
FMOD::Studio::ID explosionID = {0};
ERRCHECK( system.lookupEventID("/Explosions/Single Explosion", &explosionID) );
FMOD::Studio::EventDescription eventDescription;
ERRCHECK( system.getEvent(&explosionID, FMOD_STUDIO_LOAD_BEGIN_NOW, &eventDescription) );
FMOD::Studio::EventInstance eventInstance;
ERRCHECK( eventDescription.createInstance(&eventInstance) );
do
{
Common_Update();
if (Common_BtnPress(BTN_ACTION1))
{
// One-shot event
ERRCHECK( eventInstance.start() );
}
//... continue as before (simple_event.cpp)....
I expected to have the same behaviour of the “cancelInstance” (restart if already playing)…but the explosion doesn’t restart if I press BTN_ACTION1 (in this case “1”) again and again.
I have the same (odd) behaviour with the “Single-Shot Random” event.
The “restart if already playing” is valid with “simple Event Sound” only?
Bye, Salvo