So i wanna Instantiate a bullet at the end of my barrel and then it needs to go with speed away from the barrel (like a gun works)
But right now when i Instantiate the bullet it just falls down and has no speed, help here thanks.
Here are the code that does it
currentBullets = currentBullets - 1;
Instantiate(bullet, spawnBulletPos.transform.position, Quaternion.identity);
rb = bullet.GetComponent<Rigidbody>();
rb.velocity = new Vector3(bulletSpeed, 0, 0);
I have tried change the position of bulletSpeed to the middle or right 0 but still nothing happens?
Just let me know if you need any more code