[Update] August 15, 2022
This feature is now live, more information can be found here: Nonuniform Unions: Now Available on Production
Today we’re introducing a beta feature that allows Unions created using the CSG system to scale nonuniformly.
Enabling this Beta
You can find it in the Beta Features dialogue in Roblox Studio:
What does “allow nonuniform scale” mean?
Without this beta enabled, if you resize a Union and a MeshPart with similar contents, you’ll find that they have different scaling behavior. Specifically, Union scaling is letterboxed such that the union contents only scale uniformly:
What’s the Catch?
This may seem like the “obvious” way that things should have worked, to begin with, so there’s got to be some tradeoff that we’re making here to change the behavior right? You would be correct, there are a couple of things that we need your feedback on before we commit to releasing these changes.
Separate Behavior Changes
In a world where unions can only be scaled uniformly, separate always cleanly works because every part resulting from the separation of a uniformly scaled union can be exactly represented.
The same is not true for nonuniformly scaled unions. For example, the results of separating this stretched union of a box and sphere clearly won’t be representable with primitive parts:
-
Reset Scale: The union will be returned to exactly the size it was first created at before it is separated. This option is best when you intend to re-union the constituent parts after editing them.
-
Apply Scale: The scale will be applied as “closely as possible” to the constituent parts. Specifically, the mass/volume of the parts and the general direction the parts are facing will be the same before and after they separate.
Here’s an extreme “Apply Scale” example where all of the parts in the union must be approximated. The red is the stretched union, and the translucent gray parts are the result of separating it:
Existing Nonuniformly Scaled Unions
As pictured at the start of the post, you can actually nonuniformly scale unions right now, it just applies often undesirable letterbox scaling. This means that there are some non-uniformly scaled unions out there. Currently, this beta reinterprets the scale of those existing unions, such that they now fill the bounding box rather than being letterboxed. We have three options here:
-
Release as-is: If the impact to places is very low, we could release with the current beta behavior. That would be a breaking change because the size of the physics and render geometry for existing nonuniformly scaled unions in places would change.
-
Provide a rollout flag under workspace: We could temporarily provide a developer-controlled rollout flag under the workspace so that developers have a significant period of time to adjust to the change.
-
Provide a permanent per-union flag: We could provide a per-union property that controls the scaling behavior of that particular union, with new unions defaulting to the new behavior and old unions remaining on the old behavior.
Option three is currently the least preferred as writing third-party tooling such as plugins that properly deal with both scaling behaviors at the same time would be challenging. The plugin ecosystem would likely be fragmented with only some plugins properly dealing with both scaling behaviors.
We are leaning towards option two, but we need your feedback on this. Please let us know how many noticeable visual artifacts you see in existing places and if you find any gameplay breakage (e.g.: Not being able to pass through a gap you could before).
F.A.Q.
-
What if I want to uniformly scale a union?: Holding the Shift key while scaling any object (including a Union) with the Scale tool will scale it uniformly.
-
So you’re messing with my existing unions?: Possibly, but only if they were non-uniformly scaled with letterboxed scaling. Let us know how many noticeable changes to your places there are when the Beta is enabled so we can choose the best rollout strategy.
-
Nonuniform unions act weird under CSGv1: Creation using CSGv1 (“Enable Legacy CSG”) is deprecated. While legacy content created with CSGv1 is still supported, new CSG system features such as this may not work correctly when you have CSGv1 turned on in Studio.
-
My Union isn’t nonuniformly scaled ingame: The feature is still a Studio beta and not enabled in live games. If you really want to use a nonuniformly scaled union in a live game you can create a new union containing only that union to create an unscaled copy which could be used in a live game already (though if you try to Separate/Union it further in a Studio session without the Beta enabled you’ll get weird results).
-
I ended up with a union with a misaligned bounding box!: There’s a rare edge case where if you union more parts onto an existing union with a letterbox scaled union inside of it you can end up with a misaligned bounding box. Separating and re-unioning the misbehaving union should fix this in the unlikely event you run into it.
Wrap-up
We’re excited to see what creation possibilities you’re able to unlock with this improvement!