using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playar : MonoBehaviour {
public GameObject goal1;
public GameObject goal2;
bool check = false;
void Update(){
if(check) transform.position = Vector3.MoveTowards(transform.position, goal1.transform.position, 2f * Time.deltaTime);
if(!check) transform.position = Vector3.MoveTowards(transform.position, goal2.transform.position, 2f * Time.deltaTime);
transform.rotation *= Quaternion.Euler(0f,0f,1.9f);
}
public void change(){
check = !check;
}
}