Selection raycasting should not consider collision groups

Setting collisions between the default collision group to false in Studio prevents me from being able to click-select instances in the viewport. This is because to my knowledge the raycast created fails to collide with the instance. As a Roblox developer, this behaviour is not entirely obvious and greatly affected my workflow by destroying one of my place files until I discovered the issue.

To visualise the problem, run game:GetService("PhysicsService"):CollisionGroupSetCollidable("Default", "Default", false) in the command bar and try to select unlocked instances. It is impossible.

Since I accidentally set the collision groups, this left me confused and unable to work on my place (even when exporting it). Thanks to the help from someone, I learnt that I could fix this by typing game:GetService("PhysicsService"):CollisionGroupSetCollidable("Default", "Default", true) in the command bar.

A solution would be to prevent selection raycasting taking into account collision groups, isolating the raycast to its own unique group, or preventing developers from making the Default group not collide with itself.

Edit:

I cannot think of a valid use-case where developers would rely on the current behaviour.

It has been brought up in a recent thread about this that some plugins rely on this behaviour to make ghost parts. This should never have had to be a work-around, as it makes the above solutions harder and less likely to be introduced for the purpose of back-compatibility.

If Roblox is able to address my issue, it would help prevent me and other developers from accidentally bricking our place files and would make builders’ lives much easier.

4 Likes