#Help with Sound and Music Volume
1 messages · Page 1 of 1 (latest)
because MUSIC is using "audio LISTENER"
while sound is using set audio SOURCE
so maybe this wasnt intended. double check.
listener - only 1 per scene.
source, can have many.
does that help?
I tried using source for music but it ended up causing an error
What error?
No variable is set or something like that
I used this method for the music bar
screenshots help, where it shows both console and graph red node (where the error occurs)
I actually think I found a solution. Sorry for wasting your time
Helping others with uVS is not time wasted 🙂
Here's a video on how I did the sound + music manager with saved variable
you can use slider or whatever you want, the idea is setting an audio source component to each sound/music manager gameObject and there's that
The same logic can be applied to the music manager, right?
yeah
they are actually twins - just different variable names in another gameObject
just in case the blocks doesn't make sense, here's how it looks separated. This is the part that manages the mechanics, the rest are for UI purposes
(multiplying x10... so 0.1 in inspector shows in volume text UI as 1.
and max 1 becomes 10. Can use x100 if you want max volume to be 100 as 100%)
I can just replace the UI purpose nodes with the slider right?
yeah
the slider just gives you a value, so you use that value for your variables
should be the same: from 0 to 1. left to right.
cant say without knowing how your UI looks like (both visually / editor)
but test it !
So it works but it's only affecting the music on the next scene and not immediately on the start/settings scene. I want to have the bar scale the volume immediately when the slider is adjusted
This is what I did
it's because you are saving the slider, and not GET the slider value before setting the volume
so when you move the slider, it does nothing.
in my case, the custom events "PlusMusic" and "MinusMusic" (the ones that starts these flows)... triggers when i click these button
i dont know about sliders, but when you move them - an event should trigger so you recognize when it has changed and get that value into teh settings variables you have
another way (less performant) is to use onUpdate and check it's value on real time. so when slider changes, without events, it will get the current value on the slider and save settings.
as you can see - this is not good because most of the times you are not changing volumes 😛
so find a way, so that when you move the slider, immediately an "event" get's triggered.
and then, you get these events to start your flows.
in short, you got the events inversed.
slider set value shouldn't be at the end of the flow.
when sliders move - this initiates the new values on the variables.