Hi Creators,
Today, we are solving an existing pain point with selection mechanics in Studio, and introducing additional selection filtering capabilities while we’re at it.
Problem: Collision with Default
If you’ve ever assigned a collision group that does not collide with the Default group to some parts while editing your place, you’ll know that this comes with the side-effect of those parts not being selectable by clicking in the viewport in Studio. This usually isn’t what you intended.
The reason for this was that when doing a raycast to find out what object is under your cursor, Studio tooling used to leave the collision group filter of that raycast set to Default. The result was that anything which doesn’t collide with Default would be invisible to that raycast and not end up getting selected.
Solution: New StudioSelectable
convention
As a solution, we’re introducing a new convention in Roblox studio. All Studio tooling will use the collision group StudioSelectable
when doing selection raycasts.
This accomplishes two things:
-
You’re now free to disable collision with the Default collision group as you see fit for gameplay purposes without it impacting Studio editing behavior.
-
You can configure the
StudioSelectable
group to control what objects in your experience are candidates for viewport selection.
The Collision Groups Editor has some dedicated tweaks for working with this group. Under the hood there’s no special engine support for this group, it’s just a normal collision group like any other, but by standardizing on this convention we get extra value out of the existing collision group system.
For example, you can now assign a CollisionVolumes collision group to all of your collision volume parts, allowing you to quickly toggle between editing map geometry and collision volumes.
Plugin Users: Some plugins require an update
If you use one of the following plugins, install the most recent plugin update to avoid breakage:
- Team Create with Hats
- StudioTweaks
- Seat Preview!
How to install a plugin update
In Roblox Studio, under the Plugins ribbon bar tab click the Manage Plugins button at the left, and click the Update All button, or the individual update buttons for the plugins you wish to update. Any plugins you’ve set to auto-update will already have installed the update.
While this change is mostly backwards compatible, the above plugins create collision groups which do not collide with Default as a way to mark some parts as not selectable. We’ve worked with the authors of these plugins to ensure that they interact correctly with the StudioSelectable group after their most recent update.
Also be on the lookout for other plugins updating to support the new selection filtering mechanics.
Plugin Authors: How to update your plugins
If you’re a plugin author, please consider updating your plugins to follow this convention! When following the convention, those plugins can take advantage of the new selection filtering mechanic and avoid unintended collision group behavior.
Since there are no underlying engine changes your plugin will continue to function as it did before even without an update (with the exception of the ignoring selection use case which we contacted affected devs about ahead of time), but it only takes a small change to get the benefits.
To update your code, set the collision group on the RaycastParams passed to your cursor raycasts:
local raycastParams = RaycastParams.new()
-- Add this collision group convention.
raycastParams.CollisionGroup = “StudioSelectable”
-- Note: You should also use BruteForceAllSlow if you want
-- your plugin to be able to select CanQuery = false parts.
raycastParams.BruteForceAllSlow = true
local mouseTarget = workspace:Raycast(..., raycastParams)
Please let us know if you have any questions.
Thank you.
FAQ
Additional Details / FAQ
Do I need to have the Dragger QoL Beta enabled to get this?
- No, you’ll see this change whether or not you have the QoL Beta enabled, though if you haven’t checked it out in a while you should go check out the beta again as we’ve made significant updates to it recently.
Do I have to use the Collision Groups Editor to configure selectability?
- Since this is a convention we’d like to get adoption started as soon as possible. In the future we can offer other more convenient Studio controls to configure the underlying collision group. You could even implement a plugin that configures it today.
Should I do this on all my raycasts?
- No. Only the raycast your tooling does to find what’s under the cursor or similar should use
StudioSelectable
.
Should my cursor raycast in-experience use this?
- Probably not. However, you do have that option if you want the same selection behavior for an in-experience editor as you have in Studio. But chances are you still want to use Default or your existing raycast group in-experience.
But I already have a group called StudioSelectable
!
- What are the odds…? Regardless, we’ve got you covered! You can rename that group to something else in the Collision Groups Editor to preserve the setup you had and get a fresh StudioSelectable group.
I already have 32 collision groups… what now?
- Don’t worry! Under the hood, the
StudioSelectable
collision group is only created the first time you configure it in the collision group editor. That means your experience with 32 collision groups will continue to function, but you won’t be able to configure selectability until you free up space for theStudioSelectable
group to be created.
Won’t raycasting code error if the StudioSelectable
group doesn’t exist?
-
Yes, raycasting used to throw an error if the group did not exist. That behavior has also been changed.
Now if you raycast or region query with a group that does not exist you’ll get the same behavior as a part with a group that doesn’t exist - The nonexistent group will be treated as colliding with everything. That means the code will work as intended even in legacy places where the
StudioSelectable
group has not been created.