using UnityEngine;

public class ProjectileFlyStraight : MonoBehaviour 
{
    public float Speed = 10f;
    private Rigidbody2D rb;

    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }

	void FixedUpdate () 
	{
        Vector2 targetSpeed = transform.up * Speed;
        Vector2 accel = targetSpeed - rb.velocity;
        Vector2 force = rb.mass * accel/Time.fixedDeltaTime;
        rb.AddForce(force);
	}
}
