How do I play sound when I click on many other objects and the sound does not reset? Just with one sound object.
I have many onMouseDown objects and they all use the same sound object ( with sound script attached) ,all objects have separate actionlists and in each I have Sound: Play of my sound object. Every time I quickly click on objects sound effect is reset.
How do I make it all play on without resets and just with one sound object.
I really dont want to make 20 the same sound object and assign them in each actionlist.
Cheers
Comments
If so, try opening up SceneSettings.cs and edit line 158:
if (audioClip && defaultSound.GetComponent <AudioSource>())
to read:
if (audioClip && defaultSound.GetComponent <AudioSource>() && !defaultSound.IsPlaying ())
I just have hotspots, each has this action below, I click on them and play the same sound object.
And this is my sound object
Every time I click on hotspots the sound is reset and plays from the start.
How do I make it play on with out resets?
I know I can create 20 more sound objects and assign them. Like 1 sound object for hotspot 1, 2 sound object for hotspot 2 and so on, in that way the sounds will play on with out resets. But I would rather not do it that way.
So I'm wondering how can this be avoided.
Click object 2, sound stops and starts to play from the start. Not good.
I want:
Click object 1, sound starts to play. And continues so.
Click object 2, sound starts to play. And continues so.
Click object 3, sound starts to play. And continues so.
and so on...
I don't want "Ignore if already playing" . I want the new sounds and the old sounds keep playing.
Say you fire at random gazillions rockets from a launcher.
You would probably need to create a script that creates a sound object and attach it to every single rocket that is spawned?
Hello @ChrisIceBox I just stumbled onto this thread and I'm looking for the same solution. Could you point me in the right direction on how to get this to work?
I have 4 hotspots that each use the action "Play Sound"
I want to be able click on them separately and have the sounds play together
If I use the action "Play Oneshot", I can get them to play together, but then I can spam the hotspot and replay that same sound which is not what I'd like.
Welcome to the community, @BuckWillis.
I'm afraid I'm not clear on your meaning - does each Hotspot make its own sound? If the sounds are separate, you'd typically want each Hotspot to trigger its own Sound object.
If you can explain the situation from a gameplay/puzzle design perspective, that'll help me to figure out the best way forward.