using UnityEngine;

public class Bounce : MonoBehaviour
{
    public float bounceTime = 0.5f;
    private float timer = 0.0f;
    private bool moveUp = true;
    
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;
        if (timer >= bounceTime)
        {
            moveUp = !moveUp;
            timer = timer - bounceTime;
        }

        if (moveUp)
        {
            transform.position += Vector3.up * 0.01f;
        }
        else
        {
            transform.position += Vector3.down * 0.01f;
        }
        
    }
    
    
}
