when the player uses the teleportation skill, he is instantly teleported X distance in the direction of movement so front, back, left and right depending in which direction the player wants to go.
the first problem with this system was falling through the terrain, to stop it I added a ray below the feet of the player that points downward, if it checks that there is terrain, the player will teleport on that terrain.
also added another ray on the player's head, this one points towards the sky... if it checks that there is land above the player's head, it will be teleported with his feet landed on the above terrain.
so no more falling endlesly through the emptiness by teleporting inside the terrain...
but one problem I have never manage to fix.... teleporting inside walls or teleporting inside enemies or inside other players.