Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my camera go straight to the second camera part without lerping? [SOLVED]

I want to make a script, so the CurrentCamera's CFrame lerps from one camera part to another camera part. This is what I wrote, it fires when a remote event fires all clients.

game.ReplicatedStorage.SeatCameraChange.OnClientEvent:Connect(function()
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	for Num = 0, 1, 0.01 do
		workspace.CurrentCamera.CFrame = workspace.CameraPart.CFrame:Lerp(workspace.CloseChairCamera.CFrame, Num)
	end
end)

It doesn't move the camera. The camera goes straight to CloseChairCamera.CFrame with no lerp.

Any help would be appreciated.

1 answer

I fixed it. All I had to do was write this line of code after it.

game:GetService("RunService").RenderStepped:Wait()

This waited for the event to happen.

This discussion is preserved as it was. New answers, comments, and votes are closed.