Fading Music

Get help using Construct 2

Post » Wed Feb 19, 2014 9:51 pm

I haven't found a thread much about this but, is there a clean way so that i can make music fadeout as I leave the layout? :3
B
8
Posts: 35
Reputation: 388

Post » Wed Feb 19, 2014 10:15 pm

I have not heard of any way of going about doing this so your best bet is to create a variable that increases over a few ticks and set your gain to the negative of that variable and when it is greater than 20, move to the layout
B
6
S
2
Posts: 19
Reputation: 547

Post » Wed Feb 19, 2014 11:21 pm

Or without a variable, and using dt for a smoother effect : events
B
17
S
8
G
4
Posts: 461
Reputation: 6,137

Post » Thu Feb 20, 2014 12:19 am

Yes, this is quite simple. Whenever you would trigger to go to the next layout, delay it a bit. Have a variable as something like "fadeoutmusic" and then set it to 1 when you would end the layout. This is also a good time to fade in an all-black tiled background over top of the layout to have it fade to black, but that's for another day.

-If fadeoutmusic = 1, set audio volume to Audio.Volume("yourmusictag")-200*dt
-Compare 2 variables
------if Audio.Volume("yourmusictag") < or = 0, Go to layout, trigger once
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Fri Mar 07, 2014 6:05 pm

I'm having a bit of confusion when I try

set audio volume to Audio.Volume("yourmusictag")-200*dt

It says it's looking for a string not a number?
B
25
S
10
G
3
Posts: 154
Reputation: 2,838


Return to How do I....?

Who is online

Users browsing this forum: Malhog and 19 guests