Mouse.Target is bugging in multiple scripts

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)

Any help?

2 Likes

What does the grab script look like? The problem may be centered in there.

Well I have 2 problems about that, first is a quite big code, and then i am afraid someone would take it, may I send you in private?

You can but I’m probably about to go to sleep. I can look at it for you tomorrow.

1 Like

If anyone could help that would be awesome, because I don’t actually want to scrap the idea :confused:

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.

Fine, I will make the script public when I can, and no, there are not any errors.