Bullet shot delays when moving

Hello! So im trying to make guns, and it all went good until i noticed that when i shoot while moving, the bullet delays very much and it looks terrible.

Bullet is created and moved in server script after client gave the mouseposition

How can i fix this problem?

2 Likes

Maybe this could help?

https://developer.roblox.com/en-us/articles/Network-Ownership

1 Like

Well, this mainly occurs due to client to server delay. Perhaps also sending the bullet’s start position from the client.

1 Like

Could you provide a gif of it happening?

it doesnt need to be sented cause the start position is a part, so it can be taken from server script

Well, the problem is that when you shoot, there is a delay from when you click and shoot, and when you walk, you are actually ahead of where the server sees you are. This basically causes the bullet to seem off-positioned.

so what i did was that i sent the information about the bullet start and end position to the server.
Then the server run the moving, but because theres a delay to the server, i fired the information back to clients for all players with FireAllClients. Then every player has a script that creates and moves bullet locally.
It works perfectly now!

1 Like