Game Pauses when I teleport player

Hello. I am trying to teleport the player to a specific location which is loaded from playerprefs but for some reason everytime I start the game, it pauses and does not teleport the player.

void Start(){
 x = PlayerPrefs.GetFloat("PlayerX");
    y = PlayerPrefs.GetFloat("PlayerY");
    z = PlayerPrefs.GetFloat("PlayerZ");
    player.transform.position = new Vector3(x, y, z);
    Debug.Log("changed player");
}

Thanks in advance!

The code you’ve attached looks actually correct (as far as you have created the 3 floats in the PlayerPrefs before). So the pausing of your gaming is probably caused by something else.

Do you get any errors or warnings and could you maybe give a bit more information?

Please share at least the code which you are pausing the game with and then maybe i can help.