Beispiel #1
0
 public void damagePlayer()
 {
     if (Is_in_Fire)
     {
         PlayerC.DamagePlayer(damage);
     }
     else
     {
         Debug.Log("Missed");
     }
 }
    //damages the playeur when it is in the enemy
    public void OnCollisionEnter2D(Collision2D collision)
    {
        GameObject Enemy = collision.gameObject;

        if (Enemy.tag == "Player")
        {
            if (enableAIp.PlayerIsRange(2f))
            {
                Player.DamagePlayer(Damage);
            }
            Anim.SetTrigger("Attack");
        }
    }
Beispiel #3
0
    public void Attack()
    {
        TenColliders[tentacleNum].enabled = true;
        Collider2D hitPlayer = Physics2D.OverlapArea(hitboxes[tentacleNum], BoxDimensie(hitboxes[tentacleNum]), layermask);

        if (hitPlayer != null)
        {
            if (hitPlayer.name == "Player")
            {
                ImpairMovement();
                PlayerC.DamagePlayer(1);
                Debug.Log(tentacleNum);
            }
            else
            {
                Debug.Log("bla");
            }
        }
    }