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

mouse.Target cannot return a player's Character. Any way around this?

Asked by
Zerio920 285 Moderation Voter
8 years ago

I want function to happen if a player moves their mouse over their own character. So I have this line:

mouse.Move:connect(function()
        if mouse.Target then
            print(mouse.Target.Name)
            if mouse.Target.Parent == character then
            --etc etc

Don't worry, I've already defined "character" earlier in the script. And I know this isn't an issue with the script itself because it returns the name of everything around the character. It can't see the character itself for some reason however. Is there a workaround? Any ideas?

Answer this question