If I want to add sound effect

Should I create a new ScriptableObject for the sound effect? or should I just add the sound as an event trigger?

It’s best to create an Effect Strategy that plays a sound effect.
Of course, you can’t attach an audio source to your Scriptable Object, but you can create a Prefab GameObject with an audio source (which would have your sound set in the play on awake). The Effect Strategy should spawn that item at the appropriate location for the sound. I’d also put a script on the sound effect prefab to delete the gameobject after a time just slightly longer than the sound effect’s duration.

Thanks. It works like a charm!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms