How can i fix laggy knockback

applying body velocities to characters is usually pretty laggy and i just want to know if theres a way around it

this is an example: Watch uncapped_MedalTVRobloxStudio20240708222819-tr-edit | Streamable

1 Like

I don’t think this lag is caused by the body velocities here, but because of server lag, I will be wrong if your knockback is on the client without server comms.

no, its on the server
but either way is there a method to get around it at all?

If i am not wrong the solution for this is to use remote event and fire all clients
ServerScript:

local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent

RemoteEvent:FireAllClients()

LocalScript:

local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent

RemoteEvent.OnClientEvent:Connect(function()
	--Put knockback stuff here
end)

If you dont know what remote event is you might need to check this out
(RemoteEvent | Documentation - Roblox Creator Hub)

1 Like

You’re not wrong, putting this on the client would reduce latency, however this would be very vulnerable since it’s on the client. Even with checks on the client it wouldn’t matter since an exploiter can lie.

Please don’t use BodyVelocity at it is deprecated already. Use LinearVelocity instead.

1 Like