// Update is called once per frame void Update() { timer += Time.deltaTime; // Move the position of our object. gameObject.transform.position = Vector3.forward * Mathf.Sin(timer) * 5.0f + Vector3.left * Mathf.Cos(timer * 5); // Update which cell we are currently in. dweller.SyncCellPositionToRealPosition(); }
private void SetPosition(Vector3 newPos) { transform.position = newPos; dweller.SyncCellPositionToRealPosition(); dweller.SyncRealPositionToCellPosition(); }