Arrays

if I have a 2D top-down game with grid based movement, how can I check the map for “occupied tiles” (things the player would collide with) and put them in an array?

I see this is a sort of double post for you. In your other post, you claimed that you do not really understand arrays/2d arrays – I would suggest that you take a few minutes and learn a little about them. Look at a short example or two on the topic, and try out some small examples to get the hang of it.
That will help you a lot going forward :slight_smile:

1 Like

I’m kind of starting a tile game. Generally, it’s kind of the opposite. You position the objects on the map, and you move them from one location to the other with a astar pathfinding algorithm. There is a free astar program in the asset store aron granberg here: A* Pathfinding Project

There are also tutorials on the web. I’m using this one:

Easiest is to simply record the tile as occupied when you create or move the obstacle.

If you want to do it on the fly, you can raycast each tile.