Greetings! I want to create a kind of teleport script and i’d like to know if there is an easy approach to it. Let me give you an example about what kind of teleport i’d like to have. So, you have a First Person Controller and as soon as you see a cube near it and click with your mouse, the FPC “teleports” on the cube. Is that possible? I was thinking about Vector3 and that kind of stuff :stuck_out_tongue: Thanks

If you have a Rigidbody:

Otherwise you can just change the position

gameObject.transform.position = ..some new position..

This is really a very generic question, but the short answer would be: yes - just set an object’s transform.position to whatever position you want the object to “teleport” to. A more complete answer would require to know more specific requirements. You mention clicking on a cube to teleport on it: a Raycast using a ray constructed from the mouse position and camera would give you which cube the player has clicked on (provided the cube has a collider), and the teleport position could be derived from that (whether you want the cube’s actual position or a position relative to it, like the top of the cube, etc).

The main caveat to consider would be finding a way to determine whether or not the resulting teleport is valid, which you should be able to accomplish using Physics methods like CheckCapsule. More specific details would require more specific questions.

Here Maybe this might help
link text

look into moving something

centering the mouse in the middle of the screen

and look up raycasting to mouse the position to figure out how to find a spot to move to