Audio issues

Hello, probably you could help me. I created a game “Zombe runner” following the course, but there is nothing about adding sounds of shooting guns, steps and sounds of zombies. I googled, but it didn’t help. So I’m stuck. Maybe be you give me a hint here? I found some code lines, but I don’t know how to add them to my existing code. I would appreciate your help.

Hi CJ89,

Is this a question for the Blender subforum (see the tag of your thread)? Or a question regarding the Zombie Runner game project from the Unity 3D course? If the latter, we should change the tag to avoid any confusion.

Regarding your question, the shooting sound should be easy to implement. You know when you shoot, do you? If so, add the sound where the code for the shooting gets executed. We did something similar in the Project Boost game where we play the engine sound only when thrusting.

Adding sound to the zombies is a bit more challenging because we did not create the animations ourselves. You could look for animation events online and trigger certain sounds via an event.

I hope this helped. :slight_smile:


See also:

sorry my bad, its a Zombie Runner issue, I didn’t change the tag, as for the implementing, shoud it be here?

done, it works, thank you. What about steps? How to add them?

Have you already looked for tutorial videos on “Unity animation events” on Youtube?

Also do yourself a favour and format your code properly to make it more readable. At the moment, it looks rather like a piece of art.

So, google it… It helps a lot, thanks, as for the code - its from your course

I’m referring to the formatting, not to the code itself. When skimming the code, it looks as if the Update method was part of the OnEnable code block. One has to focus on the curly brackets to figure out how the code blocks are structured. And if one has to focus on such details, it is difficult to simultaneously understand the logic of the code. At least, I find it difficult.

Regarding the googling, yes, that’s what you could do. I gave you the relevant keywords. The alternative would be to enrol in some course but I figured that you might already have enough knowledge to learn “animation events” within 2-3 minutes and do not need an entire course to make your idea work. :slight_smile:

Please feel free to ask our helpful community of students for further advice over on our Discord chat server.

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

Privacy & Terms