How do I get the CFrame of where the ray hits a part? I want to make it where the player will be tp’d to wherever the ray hits something. The error that I get in the output is, “Unable to cast CoordinateFrame to Vector3”
Here’s my current script.
local raycastresult = workspace:Raycast(origin, direction, raycastparams)
if raycastresult then
local Position = raycastresult.Position
player.Character.HumanoidRootPart.CFrame = CFrame.new(Position)
end