Hello there!
I have a function in my code that works perfectly fine when I first call it, but when I try to call it later again in the code for some reason it starts playing everything twice. (Also if I call it for example for the 3rd time, it playing 3x times & so on)
ChooseRandomSong() : void =
var SongToPlay : int = GetRandomInt(MinSongs, MaxSongs)
Print("Song to play: {SongToPlay}")
if (Song := SongArray [SongToPlay]):
Song.Play()
if (SongText := SongTextArray [SongToPlay]):
SongText.Show()
I’m trying to call this function with ChooseRandomSong()
.
Greetings!