Exercise 4: First steps into Audio in Unity - VapaaLassi/TAMKUnity2024 GitHub Wiki
Before you start
If you press spacebar and the animals just fly through the tractors, instead of colliding, go to the top options bar to Edit->Project Settings-> Physics and set Simulation Mode to Fixed Update!
For some reason on TAMK machines, it defaults to "Script"
The actual Exercise
So when that is working as it should, we can move on to a ready-made tutorial:
https://www.kodeco.com/3713986-unity-audio-tutorial-getting-started
You should already have the project setup from Exercise 3, so you can start following the instructions right away.
Notes:
- Setting Spatial Blend higher could be necessary to hear the effects of changes to the sound of the tractors.
- You might encounter a very typical bug in the barn game object when adding a victory sound. Check closely the components of the object and the name of the function in the barn script that you add the sound playing code to. You might need to find the isTrigger-toggle on the barn collider, and turn it on.