Switching between two ambience SFX
Okay, So I am working on a 2D platformer game and want to create some audio ambience depending on where you are on the map. In my mind, it looks a bit like this:
The audio changes through a change in value and realtime parameter control in a middleware. So for instance, when a value is 1, the ambience SFX plays one sound, and when the value is 2, the ambience SFX plays a different sound. This is all controlled through the middleware.
What I want to achieve here is that whenever the player goes from A to B, lets say through a door or something, the value changes from 1 to 2, and when the player goes back through the door, I want it to go back to 1 again. And when the player goes from B to C, it switches from 2 to 3, and when the player goes back to B, the value switches back to 2 again.
I know that I can use box colliders that cover the entire area and say that when the player enters here, the SFX changes, and when I enter this other giant collider, the SFX changes again. This seems a bit excessive in my opinion, considering that this is a platformer game where the tansitions will be linear and chronological. In order to access area C, you must go through B and so on. I guess what I am really looking for is basically some sort of switch at the transition points that can change between two values. Or some sort of two-way portal that only changes a value. Does anyone know how I can achieve this?
Your answer
Follow this Question
Related Questions
Help with footstep box triggers within another box trigger. 0 Answers
When Near a door, Press a button to go to the other side. 1 Answer
Error with colliders...disabled when not even colliding 0 Answers
I need add a collider to SpringJoint2D 0 Answers
Capsule Collider goes into sphere with sphere collider 0 Answers