Hi, the fist, i dont talk english, if you dont understand nothing, is for that. I am making one game object that, if the player enter in a collision with the game object, this teleport to one specific point, but the problem is that when I active the code and the player go to the point indicated, the player can’t move, and even i can’t move whit the tool of move, this is the code:
PD: I make the game in 2D
The code of the teleporter:
public bool teleporter = false;
void OnCollisionEnter2D (Collision2D collision){
if (collision.gameObject.tag == "Player") {
teleporter = true;
}
}
And this is the code of the player:
public teleporter teleporter;
if (teleporter.teleporter) {
transform.position = new Vector3 (0, 0, 0);
}
;