Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make PlayerMouse ignore a part?

I have LocalScript in StarterPlayerScripts, which creates a part and player can control it with mouse. But i have 1 problem - when i run the game, mouse is overlapping part, and part is moving to camera because mouse position on the part.

Here is the script:

plr = game:GetService("Players").LocalPlayer

--Creating a brick
holo = Instance.new("Part", workspace.CurrentCamera)
holo.Transparency = 0.5
holo.Size = Vector3.new(4,4,4)
holo.Anchored = true
holo.CanCollide = false
holo.Material = Enum.Material.SmoothPlastic

--Moving a brick; this is the problem
while true do
	wait(0.1)
	local Mouse = plr:GetMouse()
	holo.CFrame = CFrame.new(Mouse.Hit.p)
end

1 answer

✓ Accepted answer

My solution to this was to use the Dragger object to control object dragging, but another solution is to put it inside of your character.

This discussion is preserved as it was. New answers, comments, and votes are closed.