void OnTriggerEnter2D(Collider2D Player) { if (Player.CompareTag("Player")) { CharContr CC = Player.GetComponent <CharContr>(); CC.DamageGet(CurrDamage); StartCoroutine(WaitFor(1)); Debug.Log(CC.hp); } }
void OnTriggerEnter2D(Collider2D col) { CharContr Player = col.GetComponent <CharContr>(); if (Player != null) { Player.DamageGet(damage); rb.AddForce(new Vector2(200f, 0)); } }