Gun Bullets Delayed

Hello Developers,

I am having issues with properly rendering the bullet on the client side, what I mean by this is the bullet is inconsistent with my movement. Here’s a video:

https://streamable.com/cpfgjf

Any help is appreciated!

You’re probably doing the bullet projectile on the server. You click, network latency (ping) causes a delay, then the server finally sees you shot but by that point you already moved somewhere else on the client so it looks like the bullet is coming out the wrong place. Here’s what you’d want to be doing instead.

The common steps are the following ones:

  1. In client side, play the shoot effects (bullet projectile + VFX) as soon as you click, and perform a raycast to check if it hit an enemy, if then call a FireServer.

  2. In server side, when receiving the FireServer signal, do some sanity checks to ensure there is no exploits, then call a FireAllClient and change the stats that need to be changed (ammos, health…).

  3. In client side, when receiving the FireAllClient signal, play the shoot effects for the selected player except if it is yourself, because you already played your own shoot effect on step1… it is only for the effect of others players.

1 Like

I am sorry, I am a new developer and I don’t really understand how I would do this, I am using a method called fastcast and I don’t really get how I would go about firing the bullet on all the clients using fireallclient()…

Sorry, I am not that much of an experienced developer, I understand what you are trying to say in the post, however, I just don’t get how to implement it…

If I may be blunt, it feels like you’re asking for instructions on how to bake a cake without knowing how to operate the oven. You’ll be told “you need to set the temperature to 350f for 30 minutes” but you won’t know how to set the temperature or the timer.

Play around with fastcast some more before attempting to fix the quirks it can cause. You’re experiencing first hand the kind of issues using code found online without understanding them causes and if we were to write you a gun script that did everything listed for you then you’d be adding more gaps on top of a foundation filled with gaps.

Or, don’t use fastcast at all. It’s a pretty old resource that hasn’t been updated in 4 years and I’m fairly sure it uses deprecated methods which means it will break at some point.