Hello there,
I did all this section as a challenge and I succeed except that death kick. First I used rigidbody2d.addforce then velocity as in course (actually I know both should result same in this situation). My player not dropping that force or velocity apply on it all the time but it shouldn’t I think please give it a see.
void CheckAlive()
{
Vector2 lastPos;
bool launched = false;
if(playerCollider.IsTouchingLayers(LayerMask.GetMask("Enemy")))
{
Debug.Log("Player is not alive anymore");
isAlive=false;
lastPos=transform.position;
}
if(!isAlive)
{
int counter=0;
if(!launched)
{
launched=true;
playerRb.velocity = new Vector2(Random.Range(-20,20),Random.Range(100,240));
Debug.Log("this method should be called once but called for " +counter);
}
}
}