T
Tofu Heavy Industries
Guest
ok im having trouble with object > Tile collision in GM2. The player goes too far into the tile, once he walks into one, you can move out the opposite way but cant move up or down because hes a few pixels into the collision tile.
I have a room, and it has a tileset layer called collision.
in my players object : Start Room
heres in the players "Step" event. (Some unrelated stuff removed)
Even when i set the collision box of the player to just a square, the player object still goes in 2-4 pixels deep. How do I prevent this?
youtube tuts didnt reference this usage exactly. and the tiles and player are both 16x16
I have a room, and it has a tileset layer called collision.
in my players object : Start Room
Code:
tilemap = layer_tilemap_get_id("Collision");
Code:
if (RIGHT == true) {
if place_free(x+8, y) {
move_right = true;
if ((tilemap_get_at_pixel(tilemap,bbox_right,bbox_top) != 0) || (tilemap_get_at_pixel(tilemap,bbox_right,bbox_bottom) != 0)){
x += 0;
} else {
x+= 4;
}
}
}
youtube tuts didnt reference this usage exactly. and the tiles and player are both 16x16