I'm trying to stop a say3D sound loop when the player uses the action. Here's what I have so far:
_generator1 = (_this select 0);
glb_Turn_Off_Generator = false;
publicVariable "glb_Turn_Off_Generator";
_answerAction = _generator1 addAction ["Turn Off Generator",
{ glb_Turn_Off_Generator = true; publicVariable "glb_Turn_Off_Generator"; },
[], 6, true, true, "", "_this distance _target < 3"
];
while {!glb_Turn_Off_Generator} do
{
_generator1 say3D "sound2";
sleep 7;
};
Player SwitchMove "AinvPercMstpSrasWrflDnon_Putdown_AmovPercMstpSrasWrflDnon";
deleteVehicle _generator1;
_generator1 removeAction _answerAction;
My problem is that the animation is delayed until the sound file completes its last loop. I have tried deleteVehicle, say3D "", setDamage 1. Nothing seems to interrupt the sound.
I could just reduce the sound file to one second but would be a last resort. Any ideas?