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

How do you use BindToRenderStep with a camera?

Asked by 8 years ago

I am attempting to use BindToRenderStep to create a camera that follows another object around. The "view"part is welded to the "main". The script itself is named "CameraScript" to override the default. It works great in studio mode but experiences a major FPS drop in online mode. I have already tried turning FilteringEnabled on and off. This is the code I am testing out:

local cam = game.Workspace.CurrentCamera
local runService = game:GetService("RunService")

cam.CameraType = Enum.CameraType.Scriptable

local function onRenderStep()
    cam.CoordinateFrame = CFrame.new(view.Position,main.Position)
end

runService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)

Any help would be greatly appreciated!

0
Is this a LocalScript? adark 5487 — 8y
0
Yes emaster2013 30 — 8y

Answer this question