The question is answered, right answer was accepted
Get Audio Source On Another Object
I have an audio source on another object but how can I access it from something like this:
// after the slider is updated, we can check for the other things for example play sounds:
if (source.isPlaying) return; // if we are playing a sound stop here
The script I want to access it from is called "VoiceBox"
Answer by KnightRiderGuy · Jan 05, 2016 at 04:47 PM
Ahhh for crying out loud this was what I had to do. I had to set up the Audio source as a public reference or whatever you call it ;)
public AudioSource source;
And then do this in my if statement.
if (source.isPlaying) return; // if we are playing a sound stop here
That would have been easy points for some of you code guys.... Took me a little time to mess bout with it, tried all sorts of daffy things and just got lucky with this is all ;)
Follow this Question
Related Questions
Soccer game, more realistic net 1 Answer
Problem with destroying a gameobject 2 Answers
Fade Object Out On Scene Change 1 Answer
Using One Script for Two Separate Parent GameObjects Failing 0 Answers
Select Object And Spawn it 1 Answer