Moon Animator camera speeds up at higher frame rates

I am making a cinematic cutscene with moon animator and its a 60fps animation and when you play the game at a higher fps like 144 it significantly speeds up, not sure if this is a scripting issue or moon animator

function Cinematic(CinematicsFolder)
	if Connection then Connection:Disconnect() end
	local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
	Camera.CameraType = Enum.CameraType.Scriptable
	local FrameTime = 0

	Connection = RunService.RenderStepped:Connect(function(DT)
		FrameTime += (DT * (1/DT)) 
		local NeededFrame = CinematicsFolder.Frames:FindFirstChild(tonumber(math.ceil(FrameTime)))
		if NeededFrame then
			Character.Humanoid.AutoRotate = false
			Camera.CFrame = NeededFrame.Value
		else
			

			if cutsceneSkip == true and play == false then
				Cinematic(game.ReplicatedStorage.Loop)
			else
				Connection:Disconnect()

			end
		end
	end)
end

FrameTime += (DT * (1/DT))
The above line is the same as writing this:
FrameTime += 1
because DT * (1/DT) = 1
Adding a constant value explains why differences in DT due to different frame rates aren’t adjusting your frame times

I think writing FrameTime += DT should work fine.

1 Like