Question by
ziggerastikka · Apr 20 at 09:36 AM ·
2d gamecombathealth
Can someone help me understand why my game freezes when my bosses health reaches 0
My boss's health script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MinotaurHealth : MonoBehaviour
{
public Animator animator;
public int health = 20;
public void TakeDamage(int attackDamage)
{
health -= attackDamage;
if (health <= 0)
{
Die();
}
}
void Die ()
{
animator.SetBool("IsDead", true);
Debug.Log("Enemy DieDie");
gameObject.SetActive(false);
}
}
Comment
There is nothing here to cause an application to freeze (loop indefinitely). You may want to open a .log
file and look for repeating (looped) debug messages there.
Your answer
Follow this Question
Related Questions
make an enemy spell move towards player 1 Answer
Enemy wont deal damage 0 Answers
Final fantasy style combat Scene switch question 0 Answers