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

public class ScaleOverTime : MonoBehaviour
{
    float currentYScale = 1;
    bool shrink = false;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if(currentYScale >= 0 && shrink)
        {
            currentYScale -= 0.01f;
            transform.localScale = new Vector3(currentYScale, 1 , currentYScale);
            transform.Rotate(Vector3.up);
        }
        
    }

    private void OnCollisionEnter(Collision collision)
    {
        shrink = true;
    }
}
