So what I want to do is get the Position/Name/Properties of the object my mouse is looking at. For testing purposes, I made function that would >print(MTarget) upon left clicking. However, it returns nil. When I try MTarget.Name, it gives me an error saying 'Could not index upvalue MTarget' or something.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local MTarget = Mouse.Target
Mouse.Button1Down:connect(function(MTarget)
print(MTarget)
end)
No idea what the problem is. Any help is greatly appreciated. Lemme know if you've got any questions. Thanks! :)

1 comment
Oh, I see. Didn't know it worked like that. Thanks!