_arira_
_arira_
CC#
Created by _arira_ on 1/29/2023 in #help
❔ Having trouble with a player swap function
public void swap()
{
Vector3 LastPlayerPos = transform.position;
transform.position = Clone.transform.position;
Clone.transform.position = LastPlayerPos;


}
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?
3 replies