Frictional Games Forum (read-only)
PlaySoundAtEntity not working - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: PlaySoundAtEntity not working (/thread-56777.html)



PlaySoundAtEntity not working - baegles - 06-16-2020

I am having trouble with getting the PlaySoundAtEntity script. when I enter an the area, the script    PlaySoundAtEntity("", "react_pant1.ogg", "Player", 1.0f, false);  is not working. I know the script area I have works because everything else in Brute_Spawn_01 works. It's just the sound script that won't work. What am I doing wrong?

void OnStart()
{  

    PlayMusic("04_amb.ogg", true, 1, 2, 0, true);
 
  AddEntityCollideCallback("Player", "AreaCollide01", "Brute_Spawn_01", true, 1);
  
ShowEnemyPlayerPosition("Brute01");

  RemoveTimer("StopPlayerLookAt");
  
AddUseItemCallback("", "Key01", "LevelWood", "UnlockDoor", true);
 
}


 void UnlockDoor(string &in asItem, string &in asEntity)
 {

PlaySoundAtEntity("", "unlock_door.ogg", "LevelWood", 1.0f, false);
 
SetLevelDoorLocked("LevelWood", false);
 
RemoveItem("Key01");
 
 }


 void Brute_Spawn_01(string &in asParent, string &in asChild, int alState)
 {  
 
SetEntityActive("Brute01", true);
 
StartPlayerLookAt("Brute01", 10.0f, 10.0f, "");
  
AddTimer("", 1.0f, "StopPlayerLookAt");

PlaySoundAtEntity("", "react_pant1.ogg", "Player", 1.0f, false);

SetPlayerSanity(75.0f);

 }
 
 
 void StopPlayerLookAt(string &in asTimer)
 {
 
StopPlayerLookAt();

 }