Hello!
I used an alternative way for the player to “die” and I would like to know if there are any flaws to it, because it seems much simpler then the one provided in the class:
void Update()
{
Run();
FlipSprite();
ClimbLadder();
Die();
}
void Die()
{
if(myCapsuleCollider2D.IsTouchingLayers(LayerMask.GetMask("Enemies")))
{
isAlive = false;
}
if(!isAlive)
{
runSpeed = 0f;
jumpSpeed = 0f;
climbSpeed = 0f;
}
}