How do I communicate between the client and server quickly?

writing on here crashes the tab so ill write more in the replies

Basically I want to make (part-based) bullets on the server so players see them. When I do, there is a delay large enough to make shooting feel off and i want to fix it, is there any way to shorten the latency?

you can make a bullets remote event and fire all clients

if i did it would make a bullet per-client, while they can be seen on the client as one bullet, it would be shot x amount of times, doing x amount of things when it should only be done once (explosions, damage, etc)

RemoteEvents and RemoteFunctions are the main practises of server-client, client-server, client-server-client, server-client-server(not preffered) communications.

What method do you currently use?
(Not sure what you mean by this:)

UnreliableRemoteEvents can do the job, although it is used only for specific purposes. UnreliableEvents are way faster.

1 Like

i currently use remote events to make bullets on the server

i want every bullet to appear so i cant really use unreliable remote events

1 Like

Thats fair, UnreliableRemoteEvents wouldnt be efficient in this case. Thus, all you can do is using remote events; the speed of remote events fluctuates from player to player, depending on their ms and FPS, for instance. you cant really do much to make it faster. A tip is making all you can do BEFORE using fireServer, for example, math counts, variables… and inside server script, you do what u want with the arguments.

1 Like

you NEED to use remote events if you want a responsive shooting system. Using the server to compute raycasts will just make it slow. Instead, compute raycast on client, send information to the server.

Interesting issue! I may have the solution.

What you could do is to make the bullets on the client and on the server. Then what you can do is to delete the bullets created by the server on the client.

1 Like