Mouse:SetTargetList([Instance] i)

I have a Mouse module that behaves similar to the original Mouse object. I use it as a replacement for the deprecated Mouse. It allows you to set a table of instances to ignore.

Take a look at the Project method. It uses raycasting to get information that the old mouse object would spit out. What’s nice about this is that it only raycasts on demand. When you’re not asking it to project, no raycasting will occur.

Here’s the code:

https://github.com/Sleitnick/TeamCrazyGameFramework/blob/master/src/game/StarterPlayer/StarterPlayerScripts/Main.Controls.Mouse.module.lua

1 Like