I am creating a dragging system for my Factory Simulator game, I want to change the ray that determines the location of where a dragger part is located based on mouse position and camera angle.
Heres a reference of what I made, the purple dot is the dragger object, which synced with a goal part using some physics instances:
Heres a more detailed view, with the dotted line being where the ray can be on a 2D plane (just for refrence):
Heres what I really want:
He is the line of code that really determines everything:
local CF = CFrame.new(Player.Character.Head.Position, Mouse.Hit.Position)
DragBall.GoalPart.CFrame = CFrame.new((CF + (CF.LookVector * 10)).Position) * workspace.CurrentCamera.CFrame.Rotation
Not sure where to start, any thoughts?