You still want to use BGGET, but instead of getting a variable for your bgx/by for the ground you would need the tile in the direction you're going.