I am going to make a dig tool for my game, but I need to know the name of the model I click on? How would I do this, and is there a simple method? Any help would be appreciated.
COMMUNITY QUESTION
How do I detect parts with tools?
1 answer
Use the mouse.Target method. It gives you the object that the mouse is pointed at.
For example:
local mouse = game.Players.LocalPlayer:GetMouse();
mouse.Button1Down:connect(function()
print(mouse.Target); --Will print the target that you click on.
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You should mention that this should be in a local script.