- Home /
Stop another sound from another script?
Hi guys,i need a little help.I have slow motion effect in my game,when i press specific button slow motion is going...Anyway now about thing,i have wind effect in my game,It works like this: when i fall from great height i can hear wind sound in "my ears"...Well the thing is when im falling from great height,and activate slow motion,i can still hear wind sound without any effects,LIKE NORMALLY.Well i need to stop that sound when im in slow motion and when i get out from slow motion i want that sound plays again...I hope you understand me,please help me.
Answer by Khada · Sep 20, 2012 at 02:03 PM
To stop a sound on another game object:
GameObject.Find("ObjectName").audio.Stop();
To stop a sound via a variable contained in a script on another object:
GameObject.Find("ObjectName").GetComponent<ScriptName>.AudioSourceVariableName.Stop();
Really working super perfect Thank you so much For updates version 5.+ GameObject.Find("ObjectName").GetComponent().Stop();
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
sound on key down help 2 Answers
How to loop a sound clip on a ButtonDown function 1 Answer
Wait for sound is played 2 Answers
help sound on collision when key down 2 Answers