I do believe we fix this later on but give me a shout if thats not the case and i can take another look and prompt the team to look at a potential hole in the system
Although i wonder how its saving that the guard is dead as i dont remember causing a sav on killing an enemy so it shouldnt have updated the file
Run a test for me as well making sure you delete the save file and try it to see if something was hanging over (Incidentally you may get annoyed at having to delete the save file so often so i recommend right near the state adding a delete method binded to the D key as well. Sam doe sit later but it help stop the crazies!)
OK I added an else to RestoreState in the health script, it seems to work. Basically it checks for all situations when the saved health value is not 0, then it checks if the “isDead” bool is true. If true it resets the “death” and “cancelAtack” triggers in the animator and triggers a new trigger called “LoadLife”. This trigger makes a transition from Any State to Locomotion.
public void RestoreState(object state)
{
healthNum = (float)state;
if (healthNum==0)
{
Die();
}
else
{
if (isDead==true)
{
GetComponent<Animator>().ResetTrigger("death");
GetComponent<Animator>().ResetTrigger("cancelAttack");
GetComponent<Animator>().SetTrigger("loadLife");
isDead = false;
}
}
}