Frictional Games Forum (read-only)

Full Version: how i do this, When i enter a area an music is played
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
someone know how?
Start with creating a script area in the editor and name it whatever you want. Like area_music.

Then your script should look something like this:

void OnStart()
{
AddEntityCollideCallback("area_music", "MusicStart");
}


void MusicStart(string &in asParent, string &in asChild, int alState)
{
PlayMusic("04_amb", true, 0.5, 4, 3, true);
}
Make sure the add entity collide callback is in the on start section of your script and the music start function you are calling is outside of On Start, On Enter, and On Leave.