I have a shield for my character, and I don’t want it actually interacting with the physics, but I want it to detect enemies or enemies’ attack triggers. So, I turned it into a trigger,
private void OnTriggerEnter2D(Collision2D collision)
{
if (collision.collider.CompareTag("Enemy") || collision.collider.CompareTag("AttackTrigger") && !blockHitter)
{
StartCoroutine(BlockHit());
}
}
But I get an error, “This has to be of Type Collider2D”
Does anyone know how to fix this?
Thanks