H
H
Herman Coffman2020-07-14 16:27:45
Unity
Herman Coffman, 2020-07-14 16:27:45

Vector3.forward, what's wrong?

Hello dear. The question is this: there is a simple code that creates a bullet, the position of which is set next to the barrel, and the rotation is done like the player to whom the weapon is attached.

BulletInstance = Instantiate(bullet, gunOne.transform.position, player.transform.rotation);
        //BulletInstanceTwo = Instantiate(bullet, gunTwo.transform.position, player.transform.rotation);

         BulletInstance.GetComponent<Rigidbody>().AddForce(Vector3.forward * 1000);


Everything would seem simple, but the bullets fly only in one direction.
What could be wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question