Teleportation with gun

Hi everybody ,
I am a beginner learning C# and would like to do a gun that teleport you at the specific position where the bullet hit the surface.
I have an idea of the process, but can’t found how to make a working code, maybe one of you could have some advice to help me? Any help is greatly appreciated.

Lookup raycasting to get the location your gun hits the terrain, basically you fire a line out from the end of the gun and when/if it hits something you get the location of that thing returned. Then you just make your players transform the same as the transform returned from the raycast, you probably want some error handling to make sure you don’t end up on top of another character etc. in game! :smiley:

thank you so much for the advice!
gonna learn more about raycasting and I gonna see what I can do!