Just gonna put this out there for people who were having the same issue I was having.
I don’t know how great this method is, but it’s working cosmetically flawless for me. There COULD be some drawback using it.
I basically create two raycasts, one on the client, and one on the server. The raycast on the client is strictly for the bullet cosmetic.
I then have an event called DrawRaycast which passes a table of arguments so the server can create it’s raycast and pass those arguments on to all other clients that need to see the bullet by using an event I place in ReplicatedStorage called DrawLaser.
Here’s what it looks like in code:
Creating the raycast
Making a table of arguments to send to the server
Creating the bullet for the client that is shooting
The most important part about the above is that we are binding “BindCFrame” to RenderStep which will constantly update the bullet’s CFrame, giving you that seamless and non-lagging behind effect everyone wants with raycast.
Making the event that will create the bullet for all other clients that DID NOT SHOOT THE BULLET
Again, we’re binding to renderstep, but this time we use the arguments that the server sent to us (a table of them) and set Origin, or whatever you call the variable that holds the position of where the bullet starts, to the correct CFrame. The reason we I included the “ShootPoint” into the arguments table is so the other clients could easily get the newest position of that because it’s where the bullet comes from.
Then, the server is probably the easiest part here
But yeah, like I said, feel free to critique this, I have no idea how this will even hold up but yeah, that’s how I got it to work for me.
Thanks to @KeysOfFate @Physicism @WingItMan for the help on my previous threads about Raycasting.