Exemple #1
0
    void ThrowBag()
    {
        if (Bag == null)
        {
            return;
        }

        Bag.transform.position = Camera.main.transform.position + Camera.main.transform.forward;

        VisualBag.SetActive(false);
        Bag.gameObject.SetActive(true);
        Bag.transform.parent = null;

        Bag.GetComponent <Rigidbody>().velocity = Camera.main.transform.forward * ThrowForce;
        Bag = null;
    }