Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: stigma on December 21, 2023, 12:53:48 PM

Title: [Solved]Sound zones
Post by: stigma on December 21, 2023, 12:53:48 PM
I have areas where I turn sounds off when leaving and unmute them when entering.
I have several (they are invisible meshes). Some work and others don't.
I copied the FSMs so they were all the same. What did I do wrong?
Title: Re: Sound zones
Post by: djaydino on December 21, 2023, 05:36:53 PM
Hi.
Its hard to say without seeing the fsms/states/actions setup
Title: Re: Sound zones
Post by: stigma on December 22, 2023, 02:52:35 AM
for the trigger volume, can we use a mesh of any shape, or it must necessarily be a cube?
(http://www.maximages.fr/forums/3D/playmaker/trigger.png)
Title: Re: Sound zones
Post by: djaydino on December 22, 2023, 06:32:28 AM
is there any delay inside the other fsms?

with triggers i usually set a separate fsm with a 2 states turning a bool on/off
with a trigger stay and trigger exit.

Then on the other fsm do a fsm bool test.

but if you have multiple of these sound 'listeners' in a scene you should not set it up in this way (performance wise)

you should set a 'checker' on your player.

and use for for example overlap actions instead of trigger events.

when it found a sound object, send a event to play it, then add to a list.
when its not found the next time, send a event to stop it and remove it from the list.

the overlap you can do for example every 0.2 sec (as every frame, I don't think is required for this)

trigger events are called every frame, then multiplied by your sound object count.
so if you have 10 sound objects you are checking 10 x every frame.

the overlap sample does 1 call every 0.2 sec :)
Title: Re: Sound zones
Post by: stigma on December 22, 2023, 07:55:52 AM
thank you for the clarification

Edit:
I think I will use an Asset for sound management