❔ Having trouble with a player swap function

public void swap()
            Vector3 LastPlayerPos = transform.position;
            transform.position = Clone.transform.position;                     
               Clone.transform.position = LastPlayerPos;


basically here i take the player position when the function is called and incorporate it in a variable (LastPlayerPos) Then i switch the player position with another gameobject (cloneposition) and swap the position of the clone with the lastplayerpos. It doesnt work tho, the clone teleport to the player but the player doesnt teleport to the clone. Does anyone know why?
if you make the transform.position = new Vector3(100, 100, 100) will the player teleport to coordinates 100, 100, 100?
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.