Create a raycasting system similar to this one (posted in description) for a door

Basically, I’m trying to recreate something similar to this for the raycasting and the proximity prompt:

I think you can use a beam
When the character is near the proximity prompt, it creates a beam that connects the player’s humanoid to the proximity prompt’s part.

How would you recommend making a script like this? I’ve never really used beams before, at least not in any way like this?

A beam is beam instance and two attachments, 1 attachment in character HRP, other attachment at the offset of the door activating card slot thing. Then it’s just designing it to look visually nice
https://developer.roblox.com/en-us/api-reference/class/Beam

If you are willing to, could you give an example code?

if proximityVisible ( your proximityPrompt visible thing ) then
	local HumanoidAttachment = Instance.new("Attachment") -- creates an attachment for the player
	HumanoidAttachment.Parent = player.HumanoidRootPart
	local proximityAttachment = Instance.new("Attachment")--attachment for ur proximity part
	proximityAttachment.Parent = proximityPart
	local Beam = Instance.new("Beam")
	Beam.Attachment0 = HumanoidAttachment
	Beam.Attachment1 = proximityAttachment
	-- and then you can add more different properties here by scripting
	
end

you can see many different beam editable properties here ( by scripting )
https://developer.roblox.com/en-us/api-reference/class/Beam