Substitute for RunService.RenderStepped (For when a player first joins)

Does anyone know a function that triggers when a play joins the game? I have code that will run properly if it happens, and I’ve been using RunService.RenderStepped, but but it seems to wait a second before triggering, which means the player’s camera isn’t automatically set. This happens locally (On the client), so I don’t think PlayerAdded will work.

local userInputService = game:GetService("UserInputService")

userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.UserInputType == Enum.UserInputType.Keyboard then 
		local function updateCameraCFRAME()
			game.Workspace.CurrentCamera.CFrame = game.Workspace.CameraPart.CFrame
		end
		game:GetService("RunService").RenderStepped:Connect(updateCameraCFRAME)
	end
end)

EDIT: Originally was needing help setting camera but I have that figured out and I need a subsitute for RunService.RenderStepped

try RunService.Heartbeat instead of RenderStepped

Simply putting a localscript in StarterPlayerScripts will run when the player first joins.

ReplicatedFirst or use workspace:GetPropertyChangedSignal(‘CurrentCamera’)

local camera = workspace.CurrentCamera
camera.CameraSubject = workspace.CameraPart

Literally 2 lines of code.

workspace.CurrentCamera.CameraSubject = workspace.CameraPart

The CameraSubject when set focuses on a particular instance in the worldspace. By default the Humanoid instance of the local player is assigned to this property.

Does RunService.HeartBeat run when the player first joins?

Can it still do everything a LocalScript inside of StarterGui do?

not sure but just saying RenderStepped is a better option for working with cameras.

yea. its pretty much the same .