Just to circle back on this… I wanted to post what I ended up doing in case someone else has this question and stumbles upon this in the future. The answer is embarrassingly easy and I’m kind of ashamed it took me so long to figure it out!
- I know the Y position of the bottom of my character
- I know the height of my tiles
- I know my tiles are all the same height.
So… I can pretty easily tell how far into the tile my character is just by taking the mod of the characters bottom and the tile height. Then it’s just a matter of subtracting that from the character’s Y position, which will pull them back up to be standing on the tile not into the tile.
Ground = characterBottom.Y - (characterBottom.Y % tileHeight);