I have started making a PC game using Unity. It's just a test project, where I'm making as basic as possible FPS shooter.
I'm using the FPS Controller prefab, and I have also a rifle model attached to it. The result is pretty much what I wanted.
Now I'm considering how I want to create projectiles for the gunfire. I think it will be best for me to create each bullet as just being a ray from the gun barrel heading forwards, OR I might create rigidbodies from the gun barrel I'm not sure yet.
My question is: What is the proper way to reference the point in space in which the gun barrel current ends? At the moment, I am thinking just attach ANOTHER gameObject to the gun model, and just manually position it where the barrel finishes. But this seems 'cheaty' and I think perhaps there is a better way (something like mesh.position.z + mesh.length, but I can't seem to find anything like mesh.length).
I haven't posted code at all, because I haven't really written any on this project yet.
I would also be very interested to hear the pro-tip version of how best to simulate this gunfire (ie. is it best to use rigidbodies? or somehow use raycast or something? or some better way that I haven't even dreamt of)