I have code that gets the position of any tile the player collides with inside a tilemap and it would then react how it should (spike kills you, spring is bouncy, etc) however, the side of the block is always indicated as -1 no matter what tile it is and it is possible to stand on the side of stuff like spikes because the tile_id does not update is there another property of the tileset I can get other than a position or id?
Here is my tile detecting code:
func tile_collision():
for i in get_slide_count():
var collision_object = get_slide_collision(i)
if collision_object.collider.is_in_group("PhysicalTilemap"):
tile_pos = collision_object.collider.world_to_map(position)
tile_pos -= collision_object.normal
tile_id = collision_object.collider.get_cellv(tile_pos)