To optimize asset management across your entire team or across multiple projects, you can convert single assets or asset hierarchies into packages and reuse them in multiple experiences. When a package is updated, you or your team members can update specific copies to the most current version, update all copies across an experience, or set specific copies to auto update. Packages also include a configuration mechanism that lets package creators and editors include options to customize a package's behavior.
A package can be created from any single node or sub-tree root node in the data model.
In the Explorer window, right-click the desired object/node and select Convert to Package from the contextual menu.
In the dialog window, fill in the requested details. In particular, if you're working in a group, set Ownership to the desired group in which you have permission to create/edit group experiences.
Click the Submit button.
Once complete, a "chain link" symbol over the object's icon identifies it as a package. Additionally, you'll see a new PackageLink object parented to the object.
To insert a package which doesn't already exist in the current place, you must initially insert it from the Inventory → My Packages sort.
Once you've inserted a package into a place's data model, it appears in the Packages folder of the Asset Manager and remains there even if you later delete all copies of it. However, when you publish the place, the folder will update to reflect only packages used within the place.
You can edit packages and their children just like other objects. On the first edit that modifies a package instance, an alert dialog appears, providing advanced notice that a modified package cannot be updated through any means and must be reverted to undo a series of edits.
Most edits will flag the package as modified, although the following changes are not considered package modifications:
|Changing the name of the root node.||no|
|Changing the position or rotation of the root node of a package that is a BasePart, Model, or GuiObject.||no|
|Changing the Enabled property of a root node GuiObject such as a ScreenGui, SurfaceGui, or BillboardGui.||no|
|Changing a part reference of a Weld inside the package that references an instance outside of the package.||no|
Once modified, packages with unpublished changes are marked with a yellow dot in the Explorer hierarchy.
You can include instance attributes at the root of a package to customize its behavior, for example the max speed of a packaged vehicle or the debounce time for a packaged button.
When you publish a package, the current set of attributes/values will become the package's default configurations. On any given copy of a package, configurations are shown in bold italics and those attribute values can be changed on a per-instance basis. When package copies are updated, modified configuration values will be preserved, while other attributes will be updated to the latest default value.
You can nest packages inside of other packages to maintain and collaborate on complex hierarchies, such as a series of vehicle mechanics which can be modified independently of the vehicle's parent package.
Each script within an unmodified package is read-only and shows a notification on the top with a hyperlink to unlock the script.
Clicking the hyperlink:
- Flags the package as modified regardless of whether you edit the script.
- Removes the notification/hyperlink from other scripts within the package.
Once the package is published and moved to an unmodified state, the scripts under it become read-only with a hyperlink to modify.
You can publish a modified package (marked with a yellow dot) to make those modifications available to other copies of the package throughout the place and across all experiences. Note that it's not required to publish a modified package before publishing a place (the modified version will be saved along with the place for future iteration).
To publish changes to a package:
In the Explorer window, right-click the modified copy (marked with a yellow dot) and select Publish to Package.
You can update outdated package copies to the most recent version, or you can continue to use the older version.
To update one or more package copies to the latest version:
In the Explorer window, locate outdated copies by the green sync icon next to their name.
Right-click a single outdated copy and select Get Latest Package from the contextual menu, or select multiple copies (at least one of them modified), right-click, and select Get Latest For Selected Packages.
Extensive use of packages may result in many package copies across multiple places in an experience. In addition to individual syncing and automatic updates, you can update all copies of a package through mass updating.
(Recommended) Close other Studio instances with any of the experience's places open; this prevents another unsaved instance of a place from potentially overwriting your updates.
In the Explorer window, right-click the desired package and select Update All from the contextual menu.
In the popup window, below the version/date details, check All to select all places in the experience, or select only the specific places to apply the mass update.
Click the Update button.
To make syncing easier, you can enable a package copy to update automatically whenever a newer version is published and when it exists inside an open Studio session.
In the Explorer window, expand the package's hierarchy tree and select its PackageLink object.
If desired, you can share packages with friends or grant access to specific user roles within your group.
In the popup window, select Permissions in the left column to reveal sharing/access options for either group-owned or user-owned packages.
For a group-owned package, expand the roles tree by clicking the › next to the group's icon, then choose a permission level for each role. Selection boxes that are faded/disabled indicate that the permission is already configured for that role and it cannot be changed from this window.
Permission Description Edit Members of the role will be able to use, view, and edit the current and previous package versions, including publishing changes to it. Granting edit access to a role from this window only grants access to the specific package. No Access Members of the role will not have access to any new versions of the package, although they will retain access to the current and previous versions.
For a user-owned package, search for a friend through the search field, click their avatar/username, and choose a permission level.
Permission Description Use & View The user will be able to use and view (but not edit) the current and previous package versions. Once you provide a user with this ability, you cannot revoke access to a copy they already inserted into their experience; revoking access will prevent re-insertion or package updates, but package copies in their data model will remain intact. Edit The user will be able to use, view, and edit the current and previous package versions, including publishing changes to it.
Instead of undoing an entire series of package changes one by one, you can revert unpublished changes in one action, restore a package to a previous version, or revert changes to specific configurations.
To undo an entire series of unpublished changes:
In the Explorer window, locate modified copies by the yellow dot next to their name.
Right-click a single modified copy and select Undo Changes to Package from the contextual menu, or select multiple copies (at least one of them modified), right-click, and select Undo Changes to Selected Packages.
To restore a package to a previously published version:
In the popup window, select Versions in the left column. The currently published version and previously published versions appear (V1, V2, …) along with the date/time they were published.
Click the checkmark next to the version you want to restore and click Submit.
When a package object contains scripts, or the script itself is a package, you can compare differences line-by-line using the built-in diff tool. This can help you decide whether to update as well as explore what else in the experience may need edits to make the update compatible.
To compare script changes:
In the Explorer window, right-click a modified or outdated package. Remember that the package must either be a script or contain scripts.
Select View Script Changes from the context menu.
In the Diff Result tab that opens, compare all of the changes between the current package copy and the latest published or local version, similar to source control applications.