using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class objectFly : MonoBehaviour
{
private float speed = 5f;
public Vector2 target;
// Start is called before the first frame update
void Start()
{
target = new Vector2(transform.position[0] - 30, transform.position[1]);
}
// Update is called once per frame
void Update()
{
transform.position = Vector2.MoveTowards(transform.position, target, speed * Time.deltaTime);
}
}