- Home /
Question by
UDN_46da9d8a-9968-4b83-8d65-a3ac4c8bc07e · Oct 28, 2017 at 12:14 AM ·
collider2dtilemap
Getting points (or vertices) of a TilemapCollider2D
How would I get the vertices of a TilemapCollider2D. You can get them in a PolygonCollider but why not a TilemapCollider2D ?
Vector2[] points;
if (collider.GetType () == typeof(PolygonCollider2D)) {
var polyCollider = (PolygonCollider2D)collider;
points = polyCollider.points;
} else if (collider.GetType() == typeof(UnityEngine.Tilemaps.TilemapCollider2D)) {
var tilecollider = collider as UnityEngine.Tilemaps.TilemapCollider2D;
points = ???;
}
SomeFunction (points);
Comment
Your answer
Follow this Question
Related Questions
Composite Collider on Tilemap not really stopping player 0 Answers
How to detect on which exact tile a collision happened? 2 Answers
How to get the position of a Tile my Player collided with using OnTriggerEnter2D? 0 Answers
Getting the Collider of a Tile 0 Answers
Collider2D overlap with tiles in Tilemap and remove tiles 1 Answer