|
| 27 May 2017 08:21 AM |
I want to make it so when you hover a gui, a gui will be placed where you mouse is. I tried making the gui's position mouse.hit.p, but that returns a Vector3. Can I make a Vector3 value a UDim2 value somehow?
|
|
|
| Report Abuse |
|
|
|
| 27 May 2017 08:33 AM |
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local gui = your Gui Location while true do wait(.05) gui.Position = UDim2.new(0, ((mouse.X)-90), 0, ((mouse.Y)-20)) end
|
|
|
| Report Abuse |
|
|
|
| 27 May 2017 08:35 AM |
I don't know if it would be any help but see if you can try using that.
|
|
|
| Report Abuse |
|
|
|
| 27 May 2017 08:51 AM |
Camera functions.
local pos, canSee = workspace.CurrentCamera:WorldToViewportPoint(mouse.Hit.p)
pos is a Vector3: X = X pos on screen Y = Y pos on screen Z = distance from screen
canSee is a boolean, it is true if the position is within the field of view of the camera.
|
|
|
| Report Abuse |
|
|