[Plugin] Visualize Collision and Transparency properties in Studio (Updated!)

UPDATED with new functionality - see below

Background

While building a game, it’s a good idea to optimize things to reduce the workload on the engine for handling collisions and touch events by setting CanCollide (and now CanQuery, and CanTouch properties within your parts.

The problem is there’s no really good way to visualize those properties within studio. And, if you have a big build (for example, my game has 4,700 parts and 79,000+ instances), it’s really hard to do a thorough job, and working from a script is just as hard because you have to go line by line and find each part.

So, I created this tool to visualize parts based on their properties. It was loosely patterned off of CloneTrooper1019’s Collision Groups plugin (just so I could see how to do selection boxes easily).

Usage

When you run the plugin, it gives you a GUI for selecting the property you want to visualize.

  • CanCollide - Highlights all parts with CanCollide = true

  • CanQuery - Highlights all parts where CanQuery = true AND CanCollide = false (Helpful for finding those parts where you’ve already turned off collision and want to take advantage of the new CanQuery functionality)

  • CanTouch - Highlights all the parts with CanTouch = true

  • Transparency - Colors all of the fully transparent parts

[NEW] There are also two input boxes to allow you to change selection settings. Note: Increasing these to very large amounts may impact refresh times…

  • Max Distance - How far away you want to consider for adding selection boxes. The default value is 128, which means you will visualize any part within 128 studs in any direction (creates a Region3 that is 256 x 256 x 256). To include parts further away, increase the number.

  • Max # Parts - The maximum number of parts to consider within the distance specified. If you have a large number of parts within the area being covered, you may see a message under “Max # Parts” which says “>> Max # Parts reached!”. This means there are more parts in the region than you’ve specified in the box. Keep in mind that There is no specified order in which parts are chosen for visualization, and all of the parts chosen may be ones hidden behind something else. If you want to make sure you are visualizing everything within the given distance, increase the Max # Parts value until the warning message goes away.

Examples

CanCollide:

CanQuery:

CanTouch:

Transparency:

Max Distance:

Max # Parts:

Links

Roblox:

Github:

Usage Notes:

  • To save compute cycles, all selection box refreshing is done when you press a button in the GUI. So if you move the camera somewhere else just hit the refresh button or cycle one of the settings on/off. If you change the property of the actual part, you’ll need to un-select it and then cycle the option again to refresh the selection boxes.

  • No, you can’t select more than one option at a time from the first 3. This is to prevent having to have complex logic in the plugin to display multiple criteria at once given only two view properties (selection box interior color and frame color). If there is enough demand I may consider doing something extra here. You CAN select transparency independently from the others.

  • CanQuery is in Beta, and as such it does not work fully within a TeamCreate environment. If you make changes to CanQuery, you must exit out of TeamCreate first, make the changes and save, then go back in to TeamCreate. (See this for more info: New Part Collision Property: CanQuery - Now Available! - #55 by kleptonaut)

  • Occasionally selection boxes can get “stuck” in an on or off state, usually when you are changing Max Distance. If that happens, just close and re-open the Plugin and cycle the property on/off.

29 Likes

Wow :star_struck: this is really cool, thanks for sharing your resources!

Can you put this on github so people can make contributions? (I’m interested)

1 Like

Ask and ye shall receive! Here’s the Github link!

1 Like

Cool, Sci-Fi looking, but haven’t you made this by putting a SelectionBox, checking if the property is enabled, and then set the Adornee? Doesn’t this kinda affect performance?

Yes, that’s exactly what I did. Because it’s not constantly updating every time you change the camera view, and because I didn’t get a huge area to check at one time, it doesn’t affect performance. It’s only for edit mode, not while playing. You could use it in play mode, but that’s not what it’s for.

Visualization of Raycasts would be amazing.

Updated to include visualization of Transparent parts!

I think that’s a bit beyond my skill set. I wouldn’t even know where to start on that one.

Can you add a setting to let us choose how far it scans for objects? Currently I’m trying to use this plugin on a giant terrain map I’m using, but it’s a bit hard to work with because of its size.

I get you problem added a field of view limit for performance reasons, but it impedes work flow when I’m trying to use it for huge builds like my current situation.

I’ll see what I can do. There’s also a max number of selection boxes of 1,000. Might have to make that variable too.

1 Like

I updated the plugin with the functionality you requested :slight_smile:
Enjoy!

1 Like

can you update the plugin on the roblox website to include the max search area

I could update it… If Roblox was up :sob:

how bout now lol? been a while

I’ll update it tomorrow. If you’re in a hurry you can just get the update off discord, put it in Studio and save as local plugin.

Ok, the plugin has been updated.