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.