hi!
here there is my animation for Dying.
I was wondering how to disable Main camera after diyng.
I had an idea but doesn’t work,
thanks for the help!
CODE:
void Die()
{
if (myBodyCollider.IsTouchingLayers(LayerMask.GetMask("Enemies")))
{
isAlive = false;
myAnimator.SetTrigger("Dying");
myBodyCollider.enabled = !myBodyCollider.enabled;
myFeetCollider.enabled = !myFeetCollider.enabled;
myrigidBody.velocity += new Vector2 (5f,8f);
}
}