I want to move an object in front of my player using distance relative to how much time has passed:
local con = RunService.Heartbeat:Connect(function(dt)
runtime += dt
print(runtime)
baseProjectile.CFrame = hrp.CFrame * CFrame.new(0,0,-runtime*15)
updateProj:FireAllClients({Index = index, UpdateCFrame = true, cframe = baseProjectile.CFrame})
end)
I was thinking about doing something with making the part move on the client then firing to server, then finally firing to other clients but this could be exploitable, so then I said:
“Maybe I should use my safe remote function” (makes it impossible to exploit remote functions)
then I came to the realization that lag might cause jittering between the remote function requesting the position of the projectile from the firing client, and the firing client moving the projectile on its own client.
My goal is to have some part, stay where the player is facing, increase distance base on time, but also not be mad laggy. BTW the remote event is an unreliableremotevent in case that helps. (networking stuffs I learned)