I have a few z as y isometric tilemaps each with a
Tilemap2D Collider as well as a composite collider and a rigidbody2D. Some of them are triggers while others are not. I have tried using both
Raycast2D as well as
OverlapPointAll but never seem to get a hit with the tilemap colliders…
The code running that worked on a 2D platformer tilemap (non isometric) is as follows:
Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Collider2D tiles = Physics2D.OverlapPointAll(mousePos);
//I would get a non-zero value for any hits in the console log. I always get 0's in the isometric tilemap case.
Some other things I’ve tried:
- Changing Geometry type on composite collider to polygon (from outlines).
2.Making it a trigger/not a trigger.
3.The same code seems to work for another game where it is a simple 2D platformer tilemap (not isometric tilemap)