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

How to make the mouse ignore bricks?

Asked by 8 years ago

Sorry I don't have code to accompany this. What I want is for the mouse to go past a semi-transparent part and activate a mousehoverenter script inside of a part behind it. Let me give a diagram here: Player------X----M (The dotted line is the mouse, X is the semi-transparent part, and M is the one with a mousehoverenter script in it)

1 answer

Log in to vote
1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
8 years ago

You can use the TargetFilter property of mouse. The TargetFilter and its descendants will be ignored when determining which part the mouse is pointing to:

local mouse = player:GetMouse() -- assuming player is defined
local toIgnore = PART/MODEL
mouse.TargetFilter = toIgnore
0
How would you do this using a regular script? Volodymyr2004 293 — 8y
0
This will work for server and local script, you just need to define the player. In a server script, the best way to do this is using the PlayerAdded event. BlackJPI 2658 — 8y
0
However I would advise against using this in a server script. It will still work, but it is poor design. See this page: http://wiki.roblox.com/index.php?title=Client-Server_Model_and_FilteringEnabled BlackJPI 2658 — 8y
Ad

Answer this question