Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
479 B
1
Indexable
Never
public class HexagonScript : MonoBehaviour
{
    public float shrink = 3f;

    void Start()
    {
        transform.Rotate(Vector3.forward * Random.Range(0, 360));
        transform.localScale = Vector3.one * 10f;
    }

    // Update is called once per frame
    void Update()
    {
        transform.localScale -= Vector3.one * shrink * Time.deltaTime;
        if(transform.localScale.x <= 0.05f)
        {
            Destroy(gameObject);
        }
    }
}