using UnityEngine;
using System.Collections;

public class MysticFloat : MonoBehaviour {
    public float speed;
    public float magnitude;

    private Rigidbody2D rb;
    private Vector2 oPos;
    private Vector2 cPos;
    // Update is called once per frame
    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
        oPos = rb.position;
        cPos = rb.position;
    }

	void Update () {
        cPos.y = oPos.y + (Mathf.Sin(Time.time * speed) * magnitude);
        rb.position = cPos;
    }

    public void stop()
    {
        Destroy(this);
    }
}
