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.
Answer by Mmmpies · May 25, 2016 at 08:58 AM
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! :D
Answer by Pyunyu · May 25, 2016 at 09:04 AM
thank you so much for the advice! gonna learn more about raycasting and I gonna see what I can do!
Your answer
Follow this Question
Related Questions
Teleporting problems 1 Answer
Script for teleport on collision? 2 Answers
Destroying a prefab bullet after time with the list 0 Answers
Can't teleport a car? 0 Answers
Teleport script help! 1 Answer