- Home /
Getting TilemapCollider2D (x,y) coordinate?
I'm making a 2D top down RPG game. I'm using the Unity Tilemaps with TilemapCollider2D on objects I don't want my character to walk thru. But I'm also trying to create some perspective by making the object appear in front of the character if the characters Y axis is higher than the objects Y axis and vise versa. So when I created a circle radius attached to the player that collides with object close to the player and performs this check.
The issue is that because I'm using a TilemapCollider2D and it does not give me the correct coordinates of the object i collided with. Instead it returns the whole Tilemaps coordinates. Not the object i collided with.
How do I get the coordinates of the specific collider I'm colliding with without making every collidable object into its own gameObject?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Box collider 2d detecting collisions while not actually colliding 1 Answer
Distribute terrain in zones 3 Answers
Player ignores tilemap collider on fall 1 Answer
Using two trigger colliders 1 Answer