Music not playing

My audio doesn’t play when bullets hits the enemy ship. I attached Audio Source to enemy_deathFx particle. where is the problem? should I attach a Audio Source to enemy ship?
Here the Picture

Hi,

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Are there any error messages in your console during runtime?

there is no error in console and my code is also similar with the project.

Sir. Ben mentioned that enemy destroyed soundfx attached to enemy_deathFX explosion particle.

Similar does not mean that it is equal. What are the differences between your code and Ben’s?

Is this the only sound which does not work or don’t you hear anything in Unity? If the latter, check if the sound is muted in the top menu bar of the game window.

Make sure to check play on awake as true, but I have no clue what your doing, for me the script goes on the enemies in the game, and you take the prefab of the explosion fx and put it on there.

Like that -
image

And that for the script -
image

Also how my particle prefab looks if that helps -

You need to turn on ‘Play On Awake’

Privacy & Terms