Bullet Tracer don't line up and is too slow

So currently I am working on a simple gun, but I have several problems with it

Here is most of the scripts for the game
guntest.rbxl (173.0 KB)

1 Like

It looks like you’re handling bullet tracers on the server. There will always be a delay between when you fire the Shoot RemoteEvent and when the server processes it. You should handle all of the visuals on the client (render the bullet tracer on the client when shot, then have the server relay the action to other clients), and only have the server handle the damage.

1 Like

I tried running this using a local script and a module script, would the module script slow it down?

Module scripts don’t create lag or have a performance effect? They’re just essentially scripts you require information and code from, normally a table. You can use them.

1 Like

That solved one issue but the bullets still does not leave the barrel correctly when it is fired. I also fixed the code so that the bullet is completely handled by the local script(I am ignoring damage for now). The trail now renders correctly but the bullet still does not fire correctly. I wonder if this is just a visual inaccuracy since the bullet already flew out of the barrel when you move it but… Here is the video.

moved module to replicated storage and used to local script to require it

One more thing that had to be fixed, it seems that a real bullet will be with similar bullet tracers so instead, I added in a fake tracer at the muzzle of the gun so it looks like it is coming out of the barrel. Switching the rendering to local script makes the trail load immediately.