- Home /
The question is answered, right answer was accepted
Click to Teleport
Hi! I am trying to make a 2d platformer with a teleport feature. This teleport should be a click to teleport script, so when you click on the screen the player teleports to this point, but i have no idea how to do this. i am using c#. Is there anyone who can help me?
Answer by clunk47 · Sep 04, 2013 at 05:44 PM
Have a look at the Unity Script Ref, search for transform.position.
This Tutorial / Demo Project will also get you going if you study it well.
So you're using nothing but GUI? That's the only way you're going to achieve true 2D in Unity. Otherwise, everything is still in 3D space, even if using an orthographic camera, therefore transform.position is still a Vector3(x, y, z), but you will probably just be using the x and y values, keeping z position at zero.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Is There A Way To Make Sprites Clickable? 1 Answer
Help? Problem with GUI Text button. 1 Answer
play sound on click 2 Answers
i cant tell if unity is glitching for me 0 Answers