Skip to content

Commit 0d4044d

Browse files
author
Hans Acker
committed
Isolate SE's AudioSource objects from vessel.gameObject.
Fixes the repeating decoupler sound where KSP would overwrite one of our AudioSources.
1 parent 3cace40 commit 0d4044d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Source/ShipEffectsContinued.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ void LoadSettings()
166166

167167
public bool createGroup(FXGroup group, Vessel vessel, string clip, bool loop, bool fxBypass)
168168
{
169-
group.audio = vessel.gameObject.AddComponent<AudioSource>();
169+
GameObject audioGroup = new GameObject("ShipEffects");
170+
audioGroup.transform.parent = vessel.gameObject.transform;
171+
172+
group.audio = audioGroup.AddComponent<AudioSource>();
173+
170174
group.audio.clip = GameDatabase.Instance.GetAudioClip(clip);
171175
group.audio.Stop();
172176
group.audio.loop = loop;

0 commit comments

Comments
 (0)