I've looked through the ROBLOX wiki and forums and found nothing different about them but using CFrame
values.
There is a difference.
First let me point out that mouse.hit is a property of mouse. This is a CFrame. The .p
property of a CFrame is the position of that CFrame. In other words you are getting the position of the hit CFrame by mouse.hit.p
. Origin and hit BOTH return a CFrame!
The difference is that the origin is "where the mouse came from" (its origin) and the hit is the position where the mouse - uh, well - hits.
So what is this origin then? Where does the mouse start..?
Here is the answer;
local mouse = game.Players.LocalPlayer:GetMouse() local h = mouse.hit.p local o = mouse.Origin.p local pos = game.Workspace.CurrentCamera.CoordinateFrame.p print(o, pos) --> Notice that they are (almost?) equal! print(h)
Thus the origin is the same as Camera.CoordinateFrame :) (run above in a LocalScript)