I want to keep track of all Collider2D what is touching my player.
I used: OnCollosionEnter/Exit2D with a List but it just fails to remove some Colliders.
void OnCollisionEnter2D(Collision2D coll) {
collidingTiles.Add(coll.transform);
}
void OnCollisionExit2D(Collision2D coll) {
collidingTiles.Remove(coll.transform);
}
I saw someone using the intersection of the renderer’s bounds, but I think it’s not the appropriate way. Is there a solution for this?