// Update is called once per frame void Update() { targetLocation = PC.walkingDestination; float step = speed * Time.deltaTime; if (travelling) { transform.position = Vector2.MoveTowards(transform.position, targetLocation, step); } if (Vector2.Distance(transform.position, targetLocation) < .001f) { //Tell PC it is done moving to this location PC.ChooseNewDestination(); } }