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

How to detect when player mouse hovers over a model/part while holding a tool?

Asked by 2 years ago
Edited 2 years ago

When player mouse hovers over a model/part the part inside the model appears without holding a tool, when player equips a tool and hover their mouse over a model/part the part inside the model wont appear. How do I fix this?

2 answers

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Try using Mouse.Target it detects any part that mouse is pointing at. For more information, check out the documentation of Mouse and Mouse.Target

Tool.Equipped:Connect(function(Mouse)
   local Target = Mouse.Target

   if Target then
      -- your code stuff here
   end
end)
Ad
Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

Answer this question