# Selecting Tiles and collisions

Just started using Construct 2? Post your questions here

### » Sun Sep 13, 2015 2:18 am

is there a way to select a tile by its X, Y, and ID?
and then do different collisions depending on the Tile ID?
B
14
S
6
G
1
Posts: 150
Reputation: 1,987

### » Sun Sep 13, 2015 3:41 am

There is the Tilemap.positionToTileX(xcoordinate) and Tilemap.positionToTileY(ycoordinate) for retrieving the tile X and Y. And there is the Tilemap.tileAt(tilex,tiley) to get the ID. If the ID is -1, then no tile exists at that location.
You can check if a point overlaps with a Tilemap in the system expressions, and use the point's coordinates to get the tileX,tileY , and then from those the ID. That way, you'll be able to check collisions based upon the tile ID.
B
51
S
24
G
68
Posts: 1,178
Reputation: 40,325

### » Sun Sep 13, 2015 8:32 pm

Ya I'm just going to use an object map instead of a tile map that way I can do normal object calculations
However I do need to post a topic about that

Edit: inless there is a way to select a tile ID like an object
so I can use path finding
B
14
S
6
G
1
Posts: 150
Reputation: 1,987

### » Sun Sep 13, 2015 10:01 pm

How many different types of collisions do you need? You could use a separate tilemap for each collisions type. You would just place the tiles on one tilemap that relate with a specific collision type, etc...
B
51
S
24
G
68
Posts: 1,178
Reputation: 40,325

### » Sun Sep 13, 2015 10:34 pm

well I know but if I use tiles I couldn't use things like pathfinding
or am I wrong?

Edit: I move the Grid path finding question to Here
B
14
S
6
G
1
Posts: 150
Reputation: 1,987