hi Guys
I am making a platform game (first game) and I have some problems.
when i die (reload level) my HP isnt going down plz help me i dont know what to do.
here is my script:
using UnityEngine;
using System.Collections;
public class deathPoint : MonoBehaviour {
public int maxHP = 10;
public int currentHP = 10;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if (gameObject.transform.position.y < 0)
{
Application.LoadLevel(0);
currentHP --;
}
if (currentHP <= 0)
{
Application.LoadLevel(1);
}
}
}