New Attachment Functionality

Hi Developers,

As you may already know Attachment CFrames are relative to their parent part. This means the point of origin for an Attachment is at the center of its parent. We have properties for all the Attachment’s CFrame data converted to world space, but these have been read only.

Now, you can set the world data for Attachments. Specifically, the properties are:

  • WorldPosition
  • WorldOrientation
  • WorldAxis
  • WorldSecondaryAxis
  • WorldCFrame

Generally, you should still be setting the local version of these properties when you can, but this change should make building easier as you can now quickly put 2 different attachments in the same position, or set an axis to align with the world axis. Also you can easily position an attachment anywhere in the world without needing to move the parent part.

With this addition, we are deprecating the Attachment functions:

  • Vector3 GetAxis()
  • Vector3 GetSecondaryAxis()
  • void SetAxis(Vector3 axis)
  • void SetSecondaryAxis(Vector3 axis)

These getter/setter functions were never needed since the Axis and SecondaryAxis properties could always be set directly. We will not be creating getter/setter functions for WorldAxis and WorldSecondaryAxis.

Note: There is no addition of a settable WorldRotation property as the Attachment.Rotation property is also deprecated. Orientation or either of the Axis properties should be used instead.

82 Likes

Thank you so much! Helps loads with projects I am currently working on and makes them way easier to complete. Very welcomed change!

2 Likes

Awesome! This is very useful for setting up constraints such as hinge constraints, where you need world position consistency between attachments!

2 Likes

Not sure what you mean by addition. This property did exist already, and it was deprecated as well.

6 Likes

This is so helpful, I can do so much more now.

4 Likes

What can this do that we couldnt before? Im confused. Can someone show a before/after example?

New functionality…? It seems more like making previously locked APIs available to us and removing functions that weren’t needed before.

I’m still most likely going to use local properties or object-space rotations and whatnot. I’ve never needed to use any of the world-based properties.

2 Likes

Not much. The only thing this does is simplify what you could do before. Instead of having to convert world rotation to local rotation, you can use the new property here. As for the position property, you could easily convert Vector3s to local space using the built in functions.

1 Like

Looks like most of the properties that used to say rotation has been renamed to orientation. Maybe it is a more appropriate term to use for 3D objects.

Will WorldCFrame be able to be set too?

The difference is that Orientation is applied in Z, X, Y order,
while Rotation is applied in Z, Y, X order.

1 Like

Yes, you can set it right now if you’re using scripts. CFrame properties in general aren’t shown in the property window (though I wish they were!)

1 Like

This is a great update👍. Now I have more resources to experiment with and use.

Thank you so much for this! This significantly improves my workflow when I make custom attachments for character rigs. :smirk:

I want you to understand that I love you.

2 Likes

Any chance you guys can unlock the strict Parent requirements on Attachments so we can stop putting them in Terrain and start storing them in folders & scripts? :wink:

May be off-topic (if it is I’m sorry), but how can you see that information? Is there a way for normal users and DevForum New-Members to see it?

Yeah, its part of my API Dump Tool. You can check it out here:

I might start putting the HTML API Dumps on my github.io site.

1 Like

There’s also a .txt version available in my Roblox-Client-Watch repository, but it doesn’t have syntax highlighting.

Sorry that was worded poorly, I guess what I meant was the addition of letting you set WorldRotation. We had Rotation and WorldRotation marked as deprecated, but they were tagged incorrectly. I’ve edited the post to be more clear.

1 Like