Quest State Listener and scene changes
Posted: Wed Sep 29, 2021 5:44 pm
Hi,
I have a number of characters in a scene with quest state listeners. I've attached some events upon entering certain quest states (active, success and return to NPC), one of which is a sound effect being played. Problem: it seems like the onEnterState is fired every time a scene loads, so my sound effect for entering the current quest state gets retriggered every time I switch scenes.
Is there a built-in way to avoid this behaviour, or do I have to write custom code to ensure the sound effect is only played the first time the quest state is updated?
I have a number of characters in a scene with quest state listeners. I've attached some events upon entering certain quest states (active, success and return to NPC), one of which is a sound effect being played. Problem: it seems like the onEnterState is fired every time a scene loads, so my sound effect for entering the current quest state gets retriggered every time I switch scenes.
Is there a built-in way to avoid this behaviour, or do I have to write custom code to ensure the sound effect is only played the first time the quest state is updated?