The exercise can be found in Assets
-> Scenes
-> HUDScene
and contains two main game assets:
- Player
- Medkit
This exercise adapts the exercise 3 by adapting the audio as learned in the lecture. The changes include:
- change pickup sound to be a 3D sound
- remove pickup sound from medkit and add it to soundmanager
- put logic to play pickup sound into player interaction scrip
- add background music to soundmanager
- add medkit ambient sound that is only audible when close to the medkit
- the particle effect was already implemented in exercise 3
The player game object can be manipulated through user input and the following keys:
w
- Move forwards
- Move backwarda
- Move leftd
- Move rightspace
- jump + take damage
By using the space
key while standing still the player jumps and receives 20 points of damage.
The medkit game object can be manipulated by the player object when the player enters the sphere collider of the object.
By pressing e
the user is healed for 50 points and the medkit disappears.
Besides the blender asset medkit_v2
(which can be found in the Medkit folder) all other assets were taken from the
unity asset store.
- Flooded Grounds
- Adventure Character
- Starter Assets Third Person Character Controller
- Simple Collectibles Pack
The project was created with the 3D URP template. There it happened that all shaders of the 3rd party assets were broken
and displayed in pink.
To fix this the material had to be converted with help of the URP pipeline. To do this move to
Window -> Rendering -> Render Pipeline Converter
and select all checkboxes and click Initialize And Convert