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

How to change the Position of a Label to the Position of the Mouse?

Asked by 6 years ago
Edited 6 years ago

Okay I updated my script:

Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()


Mouse.Move:connect(function()
    if Mouse.Target.Name == "Note1" then
        Player.PlayerGui.ItemPreview.Label.Visible = true
        Player.PlayerGui.ItemPreview.Label.Position = UDim2.new(Mouse.X, Mouse.Y)
        Player.PlayerGui.ItemPreview.Label.Text = "Note"
    else
        Player.PlayerGui.ItemPreview.Label.Visible = false
        Player.PlayerGui.ItemPreview.Label.Text = "N/A"
    end

end)

But it position the label with X being the Scale and Y being the Offset of the X Value in the position. And it won't appear on screen.

0
mouse.hit.p Aeike 9 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Try using CloneTrooper's 3d GUI Module. I'm pretty sure it's what you're looking for.

Ad

Answer this question