Is it possible to calculate the distance of an object to tilemap
I am trying to teleport the player but I don't want his new position to be inside the ground
this is what i'm using for the teleport function:
when btn pressed -->
if palyer mirrored ---> set player x to self.x-50
else --> set player x to self.x+50
What I'm trying to do is to add something like this
when btn pressed -->
if palyer mirrored ---> set player x to self.x-(min(50,distance( player,tile edge)))
else --> set player x to self.x+(min(50,distance( player,tile edge)))