Bullet Script Help

I have a script which is from the fps tutorial on the unity website which allows you to shoot a bullet prefab, but what it dosent do is spawn my bullet prefab at the end of my gun, please can anyone help? For some reason I cant get the script to look correct on this question even with the code sample button so here is the link. http://download.unity3d.com/support/resources/files/FPS_Tutorial_1.pdf

Where does it spawn from instead?

3 Answers

3

oh!!! I think the axis-z of your spawn point is facing down. That’s why the bullet is going downward. So try to rotate the spawnpoint to make the z-axis facing forward!

Make a small cube at the end of your gun and turn off the “Mesh Collider” component to make it invisible. Attach the fire script to that cube.

This is a round-about way of making an Empty, which can be made from the GameObject menu.

Ye, I was gonna say, rotate it lol.