I want to number tiles and when gameobject moves, the gameobject should know which tiles it’s in. I dont want to use collider. How can I do that ?
This is my game area. For example tile numbers should increase left to right. and when gameobject starts to move tile to tile, it should know which tile it’s in. For example if gameobject in tile in this image, it should know that it’s in sixth tile
Use vector positioning. Looks like its a grid so its always the same. If you use snap movement then its easy. It becomes even easier if each grid is a 1x1. Then have your lower left portion of the grid be at 0 x and 0 z. Then you know exactly where your at. So example if my tile is at x position 0 and z position 4 I know I’m in the first row 5th column (if starting at 0). You can always approximate these cells by doing a
Mathf.RoundToInt
For your x and z to guess the closest matching cell. No colliders needed. Hope this helps