Posted: 28th Apr 2023 0:15
Ok i need to figure this out so when I'm in battle mode the music fades in and out, here is what i'm trying with fails. I tried for hours.

+ Code Snippet
dec musicval#,0.1
SetMusicFileVolume( fightOrRunMusic, musicval# )
Posted: 28th Apr 2023 3:38
Ok I figured a way out with a simple function. The only thing I found out is to set the music vol first.

+ Code Snippet
function FadeMusic()
	
if fadeMusicLow=1
musicval#=musicval#-0.3
SetMusicVolumeOGG( fightOrRunMusic, musicval# )
endif

if musicval#<0 
fadeMusicLow=0
musicval#=0 
StopMusic()
endif

endfunction
Posted: 28th Apr 2023 5:35
As an idea, you could also use a custom tween to change the volume over time then stop the music when the fade tween finishes.
Posted: 28th Apr 2023 5:58
As an idea, you could also use a custom tween to change the volume over time then stop the music when the fade tween finishes.


I like that idea, ill check it out, thank you for the idea.