My script is the same as Brackeys and I can’t seem to find the problem, any help would be greatly appreciated
public class Player : MonoBehaviour
{
[System.Serializable]
public class PlayerStats
{
public int Health = 100;
}
public PlayerStats playerStats = new PlayerStats();
public int fallBoundary = -20;
void update()
{
if(transform.position.y <= fallBoundary)
{
DamagePlayer(9999999);
}
}
public void DamagePlayer(int damage)
{
playerStats.Health -= damage;
if (playerStats.Health <= 0)
{
GameMaster.KillPlayer(this);
}
}
}