How would I convert this:
while true do script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,-0.05,0) wait(0.02) end
To renderstep so my moving parts would render in the player's client instead of the game itself? Sorry, I've never used renderstep before.
local RunService = game:GetService("RunService") function onRenderStep(dt) script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, -2.5*dt, 0) end RunService:BindToRenderStep("BindingName", Enum.RenderPriority.Camera.Value - 1, onRenderStep)
This binds the function, onRenderStep
, to run every render frame before the camera controls. The function called receives an argument which represents how much time has passed since the last frame. This value is then multiplied with your angular velocity (-0.05/0.02) to calculate the number of radians to rotate by. There are also other events that can be listened to that occur at various points in the frame which you can see in the docs for RunService
.