This section is intended to reinforce what you've learned but is entirely optional. If you don't want to implement this, you can move onto the next section linked below.
HandleCollisionWithPlayer function in your
HealthPickupServerBehaviour.cs script currently attempts to heal any colliding player. If the player is already on full health, we might want to ignore them so that the health pack is not consumed.
Step 1. Write a
MonoBehaviour that exposes a player's health and attach it to the appropriate
Step 2. At the beginning of the
HandleCollisionWithPlayer function add an if-statement which reads the player's current health from the
MonoBehaviour in the step above and early return if their health is at the maximum.
Updated about a year ago
|9. Test changes|