8. Ignore healthy players

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.

The 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 Player prefab.

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



8. Ignore healthy players


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.