HI DEVS,
what is mouse.origin
robloxs definition didn’t help i know its a CFrame and that its property of the mouse but i still don’t get it
HI DEVS,
what is mouse.origin
robloxs definition didn’t help i know its a CFrame and that its property of the mouse but i still don’t get it
The origin
Mouse
property is aCFrame
indicating where the mouse originated from. It is positioned at theWorkspace.CurrentCamera
and oriented toward theMouse
’s 3D position.
Mouse.UnitRay
starts at the same position as Origin, and extends for a stud in the same direction.
read the post first before replying
so mouse.origin
is the mouses X, Y as soon as the game runs?
yes, it’s the starting point of the mouse
how is that useful???
No, it’s not.
Imagine you put a Part at the position of your camera, and you oriented that part so that it’s front face was pointing towards your mouse’s 3D position.
Mouse.Origin
would represent the CFrame of that part.
it is? yes, you can change it but it still is
I think Mouse.Origin is where the player clicks in 3D space, it’s easier to understand if you create an attachment there.
This answer was repeated many times
one more question do you get the mouse.origin
when player click or every second?
Sorry, I’m not sure exactly what you’re asking.
It’s just a property, in the same way that Name
or BrickColor
are properties of Part
s.
It will be different every time you read it, unless you haven’t moved your mouse or camera since the last time you read it.
You can get the mouse with the following:
local Players = game:GetService(“Players”)
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse() — Gets mouse instance
print(Mouse.Hit)