Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can I have a quick example of BindToRenderStep?

Asked by 8 years ago

I just want an example because this doesn't work

01game:GetService("RunService"):BindToRenderStep(function()
02Running = true
03end)
04 
05while true do
06If Running == false then
07game:GetService("RunService"):UnBindToRenderStep(function()
08Running = nil
09end
10end

1 answer

Log in to vote
0
Answered by
Klamman 220 Moderation Voter
8 years ago
1local function onRenderStep()
2    local subjectPosition = cameraSubject.Torso.CFrame
3    local cameraPosition = game.Workspace.Klamman.Torso.CFrame + offset
4    camera:Interpolate(cameraPosition, subjectPosition, 1)
5end
6 
7runService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)
0
How do I unbind it? laughablehaha 494 — 8y
0
run:UnbindToRenderStep("Camera"). Just call the run service, use the unbind function, and use the name you gave in the first parameter of the BindToRenderStep function. Klamman 220 — 8y
Ad

Answer this question