I’m trying to make it so my player’s on the client side get their camera to copy the CFrame of a part, but I’m unsure how to make the function run every 0.01 seconds or something like that. Can someone let me know how to loop a function?
If you took the time to read this, thank you for taking that time.
game:GetService("RunService").RenderStepped:Connect(function()
--code here runs prior to every frame being rendered
end)
This scenario involves manipulating the camera’s CFrame so you want to position it prior to the frame being rendered. For other uses you can use a while loop:
while true do
--make sure to use a wait() or the script will timeout
wait()
end