- Home /
Why do I have lots of 'One Shot Audio' objects in my hierarchy?
I have one object that utilizes the AudioSource.PlayClipAtPoint() method, however the object that uses it doesn't even appear in the this scene. The objects seems to be left over from previous runs of the game, and some of the objects have sound clips on them that are only apparent in another scene.
What am I doing wrong for this to be happening and how can I go about fixing it?
Do you maybe have a function like don't destroy on load? and is it visible in the hierarchy when it is not running?(this or other scenes)
I am using that function for a few objects yes, but none of those objects play the sounds that are attached to these objects.
can you check when the "one shot audio" is added in runtime? maybe there is a function connected that loops and stays creating it.
It appears that as soon as I load my level the audio for my enemies being killed is played. The problem is that no enemies are spawned in this scene and therefore shouldn't be playing their death-sound at all.
Note that this is when loading straight to that scene, not loading from another level.
Answer by tanoshimi · Dec 09, 2014 at 03:57 PM
This is the kind of problem that only you can solve... somewhere in your scene you have an object with a script attached that is generating "One shot audio" objcets. You simply need to find and disable it...