I am creating a laser game. When I played on the web, there’s a 0.1 second lag when shooting.
Is there anyway to fix this?
The client
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:Connect(function()
if script.Parent.Parent.ClassName == "Model" then
script.Parent.shoot:FireServer()
end
end)
game:GetService("RunService").RenderStepped:Connect(function()
local v = CFrame.new(script.Parent.Body.CFrame.p, mouse.Hit.p) * CFrame.Angles(0,math.rad(0),0)
script.Parent.look:FireServer(v, mouse.Hit.p)
end)