So I’m making a game where when the player clicks on a certain object they should be moved to a location. When looking online it seems that I’m doing exactly what everyone else is doing. In game it registers that the item is clicked and glitches for a second as if it will move to the location, but then the player is exactly where they were before.
{
//Identify the player
public GameObject Player;
private Transform DeskSitLocation;
private Transform PlayerTransform;
// Start is called before the first frame update
void Start()
{
DeskSitLocation = GetComponentInChildren<playerStandLocation>().transform;
PlayerTransform = Player.GetComponent<Transform>();
}
private void OnMouseDown()
{
Debug.Log("Helloo");
PlayerTransform = DeskSitLocation;
}
}
it also doesn’t work when I use .position