I have a simple LocalScript that-put simply-puts the TextLabel to the side of your mouse if you're hovering over a specific part. What's weird, though, is that the textlabel/mouse Y position moves by about 36 offset pixels up when mouseclicking. It's very odd and awkward/glitchy. That isn't supposed to happen.. right?
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() while wait() do if mouse.Target ~= nil then if mouse.Target.Name == "TestyTest" then script.Parent.TextLabel.Position = UDim2.new(0,mouse.X-30,0,mouse.Y-86) script.Parent.TextLabel.Text = "TestyTest" script.Parent.TextLabel.Visible = true else script.Parent.TextLabel.Visible = false script.Parent.TextLabel.Text = "Label" end end end
Sorry about the lag in the GIF: http://i.imgur.com/k1DmkiL.gifv
Nope, that ain't supposed to happen. Though I do not know what the direct problem is, I do have a piece of advice. Try not using while wait() do, it will clog up your game and possibly make it more laggy if there are to many of these while wait() do loops. In this case, I would do this: ~~~~~~~~~~~~~~~~~ local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.Move:connect(function() if mouse.Target ~= nil then if mouse.Target.Name == "TestyTest" then script.Parent.TextLabel.Position = UDim2.new(0,mouse.X-30,0,mouse.Y-86) script.Parent.TextLabel.Text = "TestyTest" script.Parent.TextLabel.Visible = true else script.Parent.TextLabel.Visible = false script.Parent.TextLabel.Text = "Label" end end end) ~~~~~~~~~~~~~~~~~ This is much more efficient and will cause less strain on the client in the long run. Who knows, it might also solve your problem.