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

public class Shot : MonoBehaviour
{
    private Rigidbody _rb;
    [SerializeField] private float _speed;
    private BoxCollider _bc;

    private void Start()
    {
        _rb = GetComponent<Rigidbody>();
        _bc = GetComponent<BoxCollider>();
        Invoke("turnOn", 0.2f);
    }
    void Update()
    {
        _rb.AddForce(-_speed * (transform.rotation * Vector3.forward * Time.deltaTime));
    }

    private void turnOn()
    {
        _bc.enabled = true;
    }

}
