- Home /
Question by
EpicGamer545 · Dec 01, 2021 at 09:15 AM ·
transform.positionfloatintteleport
How to calculate distance to top of ground in Unity 2D
I have made a game with teleportation mechanics like ender pearls in minecraft. Throw a pearl, you teleport where it lands. But if I throw it to the side of a tilemap block, I teleport inside the tilemap. I tried to offset it, but I need to calculate the distance to the top of the tilemap block and convert it to a float or int, and then teleport there. How to do this?
Comment