So I have a LocalScript that is made to grab a cube. Then I made a UI with a TextLabel and LocalScript that is supposed to show the TextLabel when hovering the cube.
Although the UI works, but I cannot grab the cube anymore. If I move the ScreenGui with script in another place where it doesn’t runs (e.g. ServerStorage) the cube acts fine.
The grab local script uses userInputService to detect if the player is holding the cube or not.
Local script for UI:
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local RunService = game:GetService("RunService")
local MouseGui = script.Parent.TextLabel
RunService.RenderStepped:Connect (function()
if Mouse.Target and Mouse.Target.Name == "GrabPart" then
MouseGui.Visible = true
else
MouseGui.Visible = false
end
end)
Are there any errors in the console output? I wouldn’t mind taking a look at the full script if you DM me, because it’s quite hard to pinpoint problems like these without context, unless someone else has a solution.