playMaker

Author Topic: [Solved]Sound zones  (Read 1450 times)

stigma

  • Full Member
  • ***
  • Posts: 177
[Solved]Sound zones
« 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?
« Last Edit: December 23, 2023, 05:33:37 AM by stigma »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Sound zones
« Reply #1 on: December 21, 2023, 05:36:53 PM »
Hi.
Its hard to say without seeing the fsms/states/actions setup

stigma

  • Full Member
  • ***
  • Posts: 177
Re: Sound zones
« Reply #2 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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Sound zones
« Reply #3 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 :)

stigma

  • Full Member
  • ***
  • Posts: 177
Re: Sound zones
« Reply #4 on: December 22, 2023, 07:55:52 AM »
thank you for the clarification

Edit:
I think I will use an Asset for sound management
« Last Edit: December 23, 2023, 05:33:22 AM by stigma »