BindToRenderStep not updating every frame

Hello,
I’m trying to make the player camera rotate slowly while the camera still responds to user input as normal,
I have been able to achieve the rotation effect by setting the cameratype to scriptable but this doesn’t allow for user input.
With the code below everything works as intended except, the camera rotation updates only once very second or so.
This only happens when the cameratype isn’t set to scriptable, but again if I set it to scriptable I have no input.
Your help would be appreciated.
Edit: I just found out that the rotation update speed is the same as the task.wait speed, when I change it to 0.1 the rotation is updated every 0.1s.
I don’t understand why this is happening as the updatesubject function itself is only connected to renderstep.



function CamAngle()
	
	local function updateSubject()
		-- PlayerCam.CameraType = Enum.CameraType.Scriptable
		
		PlayerCam.CFrame = PlayerCam.CFrame:Lerp(PlayerCam.CFrame*CFrame.Angles(0,0,math.rad(1)),1)
		
		-- PlayerCam.CameraType = Enum.CameraType.Custom
	end

	RunService:BindToRenderStep("UpdateSubject", Enum.RenderPriority.Camera.Value, updateSubject)
end


while true do
	task.wait(1)
	CamAngle()
end

1 Like

Why must you bind every second? Why the while loop?

1 Like

This is required for other parts of the script, this is only a small part.

Just… bind once?

What do you even mean that this is required??

If you need to bind every second then you’re doing something wrong.

1 Like

I tried binding once, I still can’t even get close to what I’m trying to achieve

You shouldn’t be so vague about what you’re doing.

…but you should UnbindFromRenderStep before binding again if you want to rebind every second.

I found a different slightly more efficient way to achieve the same result but I tried unbinding it and that works too.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.