- Home /
Question by
Mathes06 · Jan 15, 2019 at 07:50 PM ·
tilemapoverlapgrid based gamelocalpositionoverlapsphere
How to do a Overlapcirle 2d in a local Grid/Tilemap enviroment?
Right now I have the problem that I have objects in a isometric tilemap with a tile width of 1 and height of 0.5 and want to scan 2 tiles in each direction bot even when Im giving a local center point it creates a (Overlap) Circle in the world. My current script:
Vector3 center3d = tilemap.WorldToCell(transform.position);
Vector2Int center = new Vector2Int((int)center3d.x,(int)center3d.y);
float radius = 1f;
Collider2D[] hitFields = Physics2D.OverlapCircleAll(center,radius);
is there a way to just get 2 tiles radius?
Comment
Your answer
Follow this Question
Related Questions
Collider2D overlap with tiles in Tilemap and remove tiles 1 Answer
How to place an object near N number of objects in order to avoid overlap? 0 Answers
How come certain Children don't cast an Overlapsphere? 1 Answer
How can i make the Unity2d grid use rounded numbers? 1 Answer
Individual tile data 0 Answers