Im trying to make a little dot image gui act like mouse.Hit.P idk exactly how to do it so im wondering if anyone else does
bassically where ever the dots position is it will act as if the dot was the mouse
Im trying to make a little dot image gui act like mouse.Hit.P idk exactly how to do it so im wondering if anyone else does
bassically where ever the dots position is it will act as if the dot was the mouse
Sorry, I’m not sure what you’re asking for. Are you trying to find the position of the player’s mouse in 3D coordinates?
yes thats exactly what im trying to do, i couldnt find the exact words for it, well not exactly but im trying to find the position of a gui in the 3d cordinates
You can use a raycast.
Code:
local currentCamera = workspace.CurrentCamera
local myDotGui = script.Parent.Whatever
local function Get3DPosition()
local absolutePosition = myDotGui.AbsolutePosition
local unitRay = currentCamera:ScreenPointToRay(absolutePosition.X, absolutePosition.Y)
local raycastResult = workspace:Raycast(unitRay.Origin, unitRay.Direction * 100)
return raycastResult.Position
end
print(Get3DPosition())
tysm, im still new to gui scripting and stuff(i avoid it most of the time and stick to making abilities and stuff) really appreciate it bro
Yeah don’t worry, this is one of the more advanced concepts. If you need any other help, feel free to ask.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.