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

Can you get the block that the player's mouse is on using UserInputService? [Solved] [closed]

Asked by
gdunn2 54
7 years ago
Edited by OldPalHappy 7 years ago

I looked through the wiki; didn't really find anything. Hopefully, I am overlooking it. I know you can do that with the Player:GetMouse(), but it is depreciated, or whatever. If you know how to find the part the player is "pointing at", let me know.

I wouldn't think this question needs my code, but here it is:

mouse.InputChanged:connect(function(input , event)
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        --I want to put a selectionBox around the object here but don't know how to get it
    end
end)
4
Player:GetMouse() isn't deprecated? antonio6643 426 — 7y
1
i thought it was for some reason lol im using GetMouse() now gdunn2 54 — 7y
1
Yeah, just use Player:GetMouse().Target TheLuckyZ 24 — 7y
0
Be sure to put [Solved] in the title so it automatically closes. antonio6643 426 — 7y

Locked by Goulstem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?