#Cv2 audio player volume button

3 messages · Page 1 of 1 (latest)

glad flower
#

I am super bad at cv2 and can’t figure out how to make a working volume button for the audio player. If anybody can send a screenshot or even type it out what I need to make it Please Do!

sage star
balmy halo
# sage star

This system is awful @sage star @glad flower
(p.s, name your variables @sage star)

Currently, min/max volume is between [0,3], giving us very little options
What I suggest is doing a volume slider, either manually or with a custom slider

Heres what you do:
Spawn a float variable, rename it to Volume

Now, spawn in 2 buttons

  • Volume Up
  • Volume Down

Now, spawn in an Event Receiver and configure it to Update 30hz

When Volume Up is pressed, set Volume to (Volume + Delta Time
When Volume Down is pressed, set Volume to Volume - Delta Timez
You may also want to use Min and Max to clamp the volume between [0,3], since it cant go over/under

Now, when either of the buttons are pressed, it will slowly raise/lower volume smoothly
By making a volume slider, which is much harder, you can just have the players adjust the slider