Can we get CollisionGroup Property on the Mouse?

I can manually run a raycast every frame to achieve the same result, but it feels like it would just be simpler to have a Property do it in engine for me. It would be a nice improvement to the TargetFilter idea. I assume it would be more efficient if it was built into the engine instead of running in Lua but I don’t really know.


Unfortunately, the Mouse object is “legacy”:

Both PlayerMouse and Mouse are legacy APIs, superseded [Replaced] by UserInputService.

In most cases developers are advised to use the new UserInputService


Mouse has been superseded by UserInputService and ContextActionService, which cover a broader scope, are more feature rich, and support cross-platform patterns better. It remains supported because of its widespread use, but you should strongly consider using these alternatives.


It is VERY unlikely they will add new features to Mouse, to encourage the use of UserInputService and ContextActionService, because, as they say above, they allow better cross-platform programming (i.e. mobile support), and overall those APIs require less support from Roblox due to how much control they give developers.

It shouldn’t really be as far as I know, 1 raycast in Luau is 1 raycast in the engine.

1 Like

Is there a reason you can’t use RaycastParams.CollisionGroup?

1 Like

They already know how to do it on their own, they just want Roblox to do it for them.

Do what for them? The use case here seems poorly communicated.

They want the Mouse object to allow filtering by a Collision Group rather than only being able to ignore a single object because it would require less work on their part. They also say they think it would be “simpler” and potentially “more efficient”. In my own reply, I stated why this would likely not be added.

In the original post, I said: I could run a raycast every frame to achieve the same result. Not every feature request HAS to be something completely unachievable without it.

The reason I am requesting this is for convenience. As far as I know, the mouse is constantly running and updating Hit/Target. So why not give it extra functionality and make it actually useable?

But it appears no one else sees any value in this idea.