# transform.position sends object to wrong position

**URL:** https://discussions.unity.com/t/transform-position-sends-object-to-wrong-position/83051
**Category:** Questions & Answers
**Created:** [October 1, 2013, 8:05am UTC](https://discussions.unity.com/t/transform-position-sends-object-to-wrong-position/83051 "2013-10-01T08:05:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![orcinusdev](https://avatars.discourse-cdn.com/v4/letter/o/2acd7d/32.png) [@orcinusdev](https://discussions.unity.com/u/orcinusdev)
#### Post date: [October 1, 2013, 8:05am UTC](https://discussions.unity.com/t/transform-position-sends-object-to-wrong-position/83051/1 "2013-10-01T08:05:31Z")

</div>

I have a really simple code where a player enters a collider (teleport) and gets moved to another position. When i look in the unity editor, its position is not what I assigned it to (it moves to some place between the right position and the teleport.  
I’m not using any child objects.

Here is the code assigned to the teleport object.

```
void OnTriggerEnter(Collider collider){
    if(collider.gameObject.CompareTag ("Player"))
    {	
           Teleport();
    }
			
    }	
	
	void Teleport()

    {
	     PlayerController.pc.myTransform.position = new Vector3(10f, 10f, 0f);
	     PlayerController.playerSpeed = 0;
	}
}

```

(I got the same results without the teleport method where I just implement the teleport code in the OnTriggerEnter method) I have tried localPosition aswell.

For the player I just have a translation code in the update method and code for rotation based on user input.

Do anyone have a solution for me?

Its landing position can differ widely, it can be close to the right position or close the the teleport, which is very very strange

Thankfull for help

---

<div class="post-metadata">

### Author: ![orcinusdev](https://avatars.discourse-cdn.com/v4/letter/o/2acd7d/32.png) [@orcinusdev](https://discussions.unity.com/u/orcinusdev)
#### Post date: [October 1, 2013, 8:54am UTC](https://discussions.unity.com/t/transform-position-sends-object-to-wrong-position/83051/2 "2013-10-01T08:54:29Z")

</div>

In the example in the void Teleport() you can see the assigned value of the teleport position.

```
  PlayerController.pc.myTransform.position = new Vector3(10f, 10f, 0f);

```

If you want to see PlayerController script here it is:

```
using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

public static float playerSpeed = 5f;
public GameObject player;
public Transform myTransform;
public static PlayerController pc;	
public static Movement move;

	// Use this for initialization
	void Start () {
	
	pc=this;

	// Instantiate gamemode (type of rotation)	
	move = new MovementRound();

		
		
	myTransform = transform;
		
	// Instantiate position
	myTransform.position = new Vector3(0,0,0);
	
	
				
	}
	
	// Update is called once per frame
	void Update() {
	
	//Rotation
	move.Move();
		
	//Translation    
	myTransform.Translate (Vector3.left * Time.deltaTime * playerSpeed);
			
		
    }
	
	//Destroy object
	void OnTriggerEnter(Collider collider){
		if (collider.gameObject.CompareTag ("Maze")){
			Debug.Log ("Collision");
			Destroy(gameObject);
		}				
	}
}

```
