Transform.Position Help

I want to make like a teleport , changing the position of the first person controller .
Here is my script , var person = first person controller :

var person : GameObject ;

function Update () {
  if (Input.GetKeyDown ("Q"))
    person.transform.position.y = 1.381072  ;
    person.transform.position.x =  56.47888 ;
    person.transform.position.z =  47.47589 ;

Try this:
person.transform.position = Vector3( 1.381072, 56.47888, 47.47589);

Put this on your player (or any other object) then drag some other object from your hierarchy onto the "teleport" slot (this will be the end-location after teleporting , I'd create an empty game object to use as the teleport) ; after that, push play, hit the "T" key, and poof... magic.

var teleport : Transform ; //<--Drag object from Hierarchy into this in
                           //the inspector panel, the location to teleport to

var player : Transform ; //<--the transform of the object this is attached to

function Awake(){
player = transform ; //<--I'm guessing this is why yours wouldn't work. You put
}                    //your person var at the top for caching, but never cached
                     //it's value in awake() or start() ; Either that, or you had
                     //attached your script to some other object and forgot to
                     //drag&drop your player into the slot for 'person'

function Update(){
        TeleportMe() ;

function TeleportMe(){
   player.position = teleport.position ;


I use c# so my approach is a little different.
I have used the vector3 assignment approach rather that the individual x and y and z approach.
can you be sure that the event is fireing?
Place the java equivilant to "Debug.Log(“Q entered”); into your assignemnt routine and inspect the console to see if it is getting fired. Maybe a lowercase Q is being processed.
If the routine is being processed then you will see a message.

That being said, Instead of polling in the Update cycle, why don’t you use the onKeyDown event?

It only gets fired once when the key is pressed. Now again i say that i come from the (or programming world and all my business apps are event driven. I am not sure if this event is available in Java.