Frictional Games Forum (read-only)

Full Version: Sound Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to set this sound up where when the player crosses a script area (ScriptArea_2) a sound plays. I'm rather sure I've gotten the script for sound correct:

Quote:PlaySoundAtEntity("running", "step_run_wood.snt", "PosNodeArea_1", 1.0f, false);

But I am clueless as to how I run that once the player enters the script area.
You need a collision callback:

Code:
void OnStart()
{
    AddEntityCollideCallback("Player", "ScriptArea_2", "OnEnterArea2", true, 1);
}

void OnEnterArea2(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("running", "step_run_wood.snt", "PosNodeArea_1", 1.0f, false);
}