Hi i am trying to do a Teleportation script like Nightcrawler from Marvel.When i click i can teleport anywhere within range,but i can’t find any tutorials About that i can only find Teleportation with Teleportation pafs or Portal gun.Any idea to help me?
The only thing you need to do to teleport an object in Unity is simply this:
Vector3 teleportDestination = /* <your teleport destination here> */;
transform.position = teleportDestination;
Of course you might want to have a cool visual effect happen at the same time! I would look into Particle Systems or Visual Effects in Unity to achieve that:
https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@8.1/manual/index.html
1 Like
Thanks for the answer but i want it like a circle that with my mouse i can select where to teleport.This Scene will be 3rd Person.There was a game named Jumper on ps2 something like that.
Use a Raycast from your camera position:
You will get the position on the ground as a result. Make your validation afterwards, like a
Vector3.Distance(player.transform.position, hit.transform)
to see if the teleport was in range
1 Like
Thanks man i will try as soon as i can.
It will be insane, believe me!