I have just recently been getting this bug.
Studio: https://gyazo.com/594ed6c464d4e3ffa3bb7e512a1a45b9
Game: https://gyazo.com/e3851953665eb0fd70c5652fdecd2a21
Does anyone know how to fix this? Does it have anything to do with the ROBLOX error code 177?
When testing in-studio, communication with RemoteEvents to the client are almost instant. Once you start getting in-game, it is much slower. I'm assuming you are rendering this on the server side.
In order to fix this "delay", you have to do the rendering client-side. We want the LocalPlayer
to feel as if their actions are instantaneous. It will render on their screen perfectly, then tell the server that it did an action. Now the server has a couple of options.
The server can either render it and make the player who requested to render it not display it (deleting or setting transparency).
The other route is to have the server :FireClient()
to the other players and have them render it on their screens.
This will make it delayed for everyone else, but instant for the player who ran it. Good luck, those effects look pretty cool.
Edit: Here is a script explaining what to do.
LocalScript
RemoteEvent.OnClientEvent:Connect(function(arg1) local character_who_FireServer = arg1 local referencePoint = character_who_FireServer.Head.Position end)
ServerScript
RemoteEvent.OnServerEvent:Connect(function(player, arg1) local player_who_FireServer = player --This event will always tell you the PlayerObject --that fired the remote (first parameter). local character_who_FireServer = arg1 for i,v in next, game.Players:GetPlayers() do if (v ~= player_who_FireServer) then RemoteEvent:FireClient(v, character_who_FireServer) end end end)
Now once you :FireServer()
, you have to provide arguments (arg1
) to send in this case we need a reference point.
local arg1 = LocalPlayer.Character RemoteEvent:FireServer(arg1)
See how arg1
travels to the ServerScript. The ServerScript then loops through all the players except the player who fired the event. The rest of the clients will receive the information with the Character
object the LocalPlayer
fired. Now you can use the LocalPlayer's Character
as a reference point for all the other clients.