# Best practice for play location of projectile sound effects?

I am encountering an issue where I have a bullet that is destroyed on impact which is cutting off my bullet impact sound effect due to the audio source being destroyed. I like the idea of the sounds being attached to the projectile, but not sure if that is best practice.

I can play the sound from an NPC script, but not sure if that will open up other issues. Is this a better approach since the NPC material is "metal" so I should store all the "Metal hit" sound effects on the NPC?

...vs. having to store all material variations of impact on the projectile?

One way to avoid the audio ceasing when the projectile is destroyed is to call the static method AudioSource.PlayClipAtPoint. This fires a "one-off" sound effect, without being attached to any one specific audio source object.
To avoid storing a lot of different material hit sound effects on each and every projectile, you can define a type deriving from ScriptableObject that's something like a "Sound Set" data container. Load up this type with fields/methods to store and select the right sound effect for each material. Then you can create multiple sound sets as assets in your project folder, and share them between many projectiles. Each projectile can hold a single reference to a sound set, and delegate to it the complexity of selecting the right audio clip for the circumstance, keeping your projectile scripts focused on the work of being projectiles.
• Noted on the Sound Set Data container. As for the PlayOneShot, I must be missing something because the sound playing or not playing in the code below is based on if I comment out the destroy or not (doesn't play if destroy is called)</br> health.TakeDamage(damageAmount, damageType); sfx.PlayOneShot(RandomClip(), sfxVolume); var newBulletHitFX = Instantiate(bulletHitFX, transform.position, Quaternion.identity); //, this.transform.rotation Destroy(gameObject); – benbastien Jan 30 at 5:52