using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class attract : MonoBehaviour {

	[SerializeField]
	private GameObject player{ get; set; }
	private Rigidbody2D body{ get; set; }
	public Vector2 velocity = Vector2.zero;

	// Use this for initialization
	void Start () {
		body = GetComponent <Rigidbody2D> ();

	}

	// Update is called once per frame
	void FixedUpdate () {
		Vector2 toTarget = player.transform.position - transform.position;
		float speed = 1.5f;

		transform.Translate(toTarget * speed * Time.deltaTime);
	}
}
