Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Mouse cursor's position is not matched in Udim2?

Asked by 5 years ago

Here is my code:

local mouse = game.Players.LocalPlayer:GetMouse()
local mouseUdim2 = UDim2.new(0,mouse.X,0,mouse.Y)
local Label = script.ImageLabel
Label.Parent = script.Parent
Label.Position = mouseUdim2

When I test it, the mouse's udim2 position is in the wrong place. It is at the bottom of the screen. What happened?

1 answer

Log in to vote
-1
Answered by 5 years ago
Edited 5 years ago

dude it should work and YOU ACTUALLY HELPED me on what I was trying to do thank you here's me final code (its a drawing system):

while true do
local mouse = game.Players.LocalPlayer:GetMouse()
local mouseUdim2 = UDim2.new(0,mouse.X,0,mouse.Y)
local Label = script.Parent.ImageLabel
local Clone = Label:Clone()
Clone.Parent = script.Parent
Clone.Position = mouseUdim2
wait(0.001)
end
Ad

Answer this question