Introducing the StudioSelectable Collision Group

I actually have a script set every object’s collision group after the game starts but this is super useful!
Thanks so much for this update!

2 Likes

Wow, it’s great to see Roblox doing something so unexpected but welcomed! Let’s hope this becomes the norm instead of just a rare thing.

5 Likes

This isn’t the first time it’s happened, actually :slight_smile:
A while back I got contacted by the very same staff member about a post I’d made on scriptinghelpers about a function they were deprecating. I had long forgotten the post but it was good to see that the impact of the change was being considered to the point that 7 year old posts were being followed up on!

5 Likes

By default, the player’s character is the player’s “replication focus.” This basically means that the game loads parts near the player’s character. If you wanted to stream around a part for a cutscene, you would set the replication focus for that specific player to a part nearby the scene, so that the scene can be loaded.

You can read more about ReplicationFocus here: Player | Documentation - Roblox Creator Hub

4 Likes

I like this kind of simple but useful updates for many developers, thanks for these updates!

4 Likes

Nice update. However, I have a question. What does BruteForceAllSlow mean exactly? Is it slow to use? Appreciate it.

4 Likes

CanQuery = false says “I don’t want raycasts / region queries to see this”, and when you do that the engine can optimize things to some extent because it doesn’t need to do as much tracking of them.

BruteForceAllSlow = true says “No U, stop ignoring stuff, I really want to actually query even CanQuery = false things”. That comes with a performance penalty because the engine already assumed those things would not be queried and has to use a more brute force approach to find them.

That extra perf cost is not generally an issue when you’re doing a single raycast to find what’s under the cursor, and it’s often desirable for plugins to work on CanQuery = false parts. On the other hand, you probably don’t want to make use of that flag on a raycast you’re doing a hundred times per frame during gameplay.

8 Likes

Hey, I can see this being very useful in certain times where I don’t want to use .Locked and filter out some BaseParts to be selectable, thank you!

but will studio still be able to select parts that have Query off / CanQuery = false?

4 Likes

Yes, the Studio tooling always includes CanQuery = false parts. In fact, with this update, some additional tools which weren’t updated to understand CanQuery when that property was introduced have now been updated to handle it correctly.

For example, the Attachment creation tool no longer ignores CanQuery = false parts.

6 Likes

That great! I really needed this because most of my BaseParts have CanQuery = false by default,

now we have the ability to filter out certain types of parts without using .Locked and ability to categorize them, for example I might want to select Invisible barriers at some point but would want to ignore them at a later point when working with other things!


@tnavarts

the example explanation and instructions is a bit unclear to me

so if I want my mouse in Roblox Studio to ignore a BasePart do I assign “StudioIgnore” collision group and disable collision with “StudioSelectable”?

4 Likes

This is a really awesome addition!

I threw together this little plugin that utilizes StudioSelectable to allow users to click through locked parts, but the necessary CollisionGroup property changes means that saving/publishing with the plugin enabled could interfere with a user’s game functions.


Could something like this be built into Studio as a toggle so that CollisionGroup property overrides are not required? Disabling the selection of parts because a locked part is in the way can be a little bit frustrating sometimes, especially when the locked parts are transparent.

5 Likes

Yes, you create an additional collision group to be assigned to a particular set of things you want selection to sometimes ignore, and disable collision between StudioSelectable and that group when you want those things to be ignored.

5 Likes

Next on the wishlist : the ability to disable raycast detection on objects with CanCollide = true…

4 Likes

This is a tricky one. Locked serves an important purpose, of being used on baseplate / backdrop parts that separate areas of the map. For example, if you have anything under the baseplate, and you’re allowed to click through locked things, now you might accidentally move stuff under the baseplate when you wanted to deselect your currently selected object by doing a dead click.

The current locked behavior is mostly an artifact of the fact that you put all your stuff in one shared 3d space on Roblox instead of having separate distinct 3d scenes the character explicitly moves between. Locked parts serve as a boundary to prevent editing out of the scope of the “scene” you intended to edit.

7 Likes

You can’t use GetPartsInPart using a CollisionGroup unless that CollisionGroup is also colliding with Default.

Ex: Two parts with Bullet collision group wont detect each other unless their collision group collides with BOTH Bullet and Default. Only colliding with Bullet is not enough.

I have no way of reporting this normally, so hopefully you’ll read this.

2 Likes

I sometime not able to select some parts they are not locked and i dont know why i can select them

Could you DM me the place file or a reduced test case that demonstrates the unexpected behavior?

+1 for yet another awesome feature addition. Great job roblox team, coming from unity, I love this platform

This also begs the question, is there a standardized (or widely agreed upon) unselectable group name? I’ve always used Plugin_Unselectable_Group for my googly eyes plugin, but now the casing interferes with StudioSelectable, and I’d preferably like as many plugins using the same group name as possible.


Edit: Keeping it simple, I’ve settled on StudioUnselectable as the unselectable group name. If any fellow plugin devs would like to follow this standard, put this somewhere in your plugin:

if not PhysicsService:IsCollisionGroupRegistered("StudioSelectable") then
	PhysicsService:RegisterCollisionGroup("StudioSelectable")
end

if not PhysicsService:IsCollisionGroupRegistered("StudioUnselectable") then
	PhysicsService:RegisterCollisionGroup("StudioUnselectable")
end

PhysicsService:CollisionGroupSetCollidable("StudioSelectable", "StudioUnselectable", false)

Then, set BasePart.CollisionGroup = "StudioUnselectable" on anything you don’t want the user to select.

You could be the standard: You could get together with some other plugin authors and agree on something to use.

1 Like