Why is RenderStepped being slow?

I’m trying to make the mouse detect when it hits a drawer, but I noticed the updating on RenderStepped is very delayed and even occasionally pauses while the rest of the game runs fine.

local players = game:GetService("Players")
local player = players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char.Humanoid or char:FindFirstChild("Humanoid")
local mouse = player:GetMouse()

local cam = workspace.CurrentCamera

local drawer = workspace.Drawer

local point = Instance.new("Attachment")

function update()
	local orgin = cam.CFrame.Position
	local direction = mouse.Hit.Position - orgin
	
	local params = RaycastParams.new()
	params.FilterType = Enum.RaycastFilterType.Exclude
	params.FilterDescendantsInstances = {char, cam}
	
	point.Parent = workspace
	point.Visible = true
	
	local newRay = workspace:Raycast(orgin, direction, params)
	
	if newRay then
		print(newRay.Instance)
		
		point.WorldPosition = newRay.Position
		
		if newRay.Instance == drawer then
			drawer.Highlight.Enabled = true
		else
			drawer.Highlight.Enabled = false
		end
	end
end

game:GetService("RunService").RenderStepped:Connect(update)

Can you please add a print statement as the first line of the update function and send an updated video? It’s odd that it is behaving that, and I just want to double check whether it is actually firing or not. (rather than relying on a print statement within an if statement)

Replace:

local newRay = workspace:Raycast(orgin, direction, params)

with:

local result = workspace:Raycast(origin, direction * 1000, params)

The key is the * 1000 part.