Part attachment improvements

Hey everyone, here’s a brief update on some of the things I’ve done over the past couple of weeks.

Attachment type filtering

Sometimes when attaching a part, other unwanted attachments might be created between that part and other adjacent parts, which the player then has to go and delete afterwards.  It would be more convenient if these attachments weren’t created in the first place.

Here’s an example where we’re aligning a beam to an axle, but additional unwanted attachments are being created between the beams:


As an attempt at a solution to this, I’ve implemented a way to filter out attachment types during part alignment.  There’s now an “advanced options” panel in the builder tool UI, which allows each attachment type to enabled or disabled for part attachment.

Here the fixed attachment type has been disabled in the advanced options panel:


Any disabled attachment types won’t be considered when determining if parts can align together, and any newly created attachments won’t be initialised to a disabled type (and will fall back to the next available allowed type).

So in the example with the beam and axle, disabling the fixed attachment type will prevent attachments from being created to the adjacent beams, but will still allow a rotary bearing attachment to be created between the beam and axle.

Here a rotary bearing attachment is about to be created between the beam and axle, but no other attachments between the beams:


I’ve also modified the builder tool display screen to show which attachment types are currently allowed, as you can see in the images above.

Part interpenetration

There was a bug where, by quickly dragging a selected part while clicking to attach it, it was sometimes possible to attach it such that it interpenetrated another part.

To solve this I now use the attachment’s position and orientation to calculate each part’s new local position and orientation when merging composites together.

However, I think there is value in allowing part interpenetration, as it opens up creative possibilities for advanced users!  So, I’ve added an option to the builder tool UI advanced options panel to turn off the part interpenetration test.

I’ll be releasing a demo update very soon with these changes, plus the new builder tool model, and more, so watch out for that!