Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a Raycasting Gun with Filtering Enabled on have little Delay?

Asked by
Xduel 211 Moderation Voter
7 years ago

So while I say a 'raycasting gun', I will use an answer for more complicated things, this is just a simple example I can think of.

Currently I am having the issue where, if I wanted to make a laser gun with Filtering Enabled on, when the beam is cast to from the gun to the target in the server (so that all players see the beam), there will be a slight delay with the raycasting as a RemoveEvent is being used.

Because of this, the beam's start position is delayed from where the current start position would be, causing the beam to be offset from the gun and look very ugly.

Aside from making the Ray local and thinking of clever ways (maybe with sounds and particles) to hide it, Are there any methods I can use to reduce the delay significantly? I'm guessing not, but I'd say its good to ask. Thanks.

0
Raycast from the client and send that info to the server. RubenKan 3615 — 7y
0
If you don't like the look only, I can give you the script where it positions the bullet smoothly BakonBot 26 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago

There is always going to be a slight delay, even if FilteringEnabled is off. In a non filtering-enabled game, the client renders the ray, and then replicates that to the server, where it is sent to the rest of the clients. You don't see the delay, but other players do.

For aesthetic purposes, the best solution is to firstly render the ray on your client, and then fire your RemoteEvent to the server. Although this is not a complete solution to the problem, the issue is that is that there will always be a little bit of delay—that's just how the internet works, even in a non FilteringEnabled game.

Ad

Answer this question