Hi,
I have the code below attached to a “Player Rival” Game Object:
public int Damage = 1;
void OnTriggerEnter(Collider collision)
{
if (collision.gameObject.tag == "player")
{
collision.gameObject.GetComponent<FallDown>().TakeDamage(Damage);
}
}
And I have the “Player” Game Object with a FallDown script attached which gets effected when “Player Rival” collides with it:
public int maxHealth = 1;
private int currentHealth;
public void TakeDamage(int amount)
{
currentHealth -= amount;
if (currentHealth <= 0)
{
Die();
}
}
void Die()
{
animator.SetTrigger("Fall");
GetComponent<Collider>().enabled = false;
this.enabled = false;
}
}
What do I want is seems like I need a public Handler which triggers the “Player” to get him up after a certain seconds since I haven’t got any idea of how to set this Handler.
Any suggestions would be gladly appreciated.