All the work related to preparing and building the geometry bundle of the artifact will be done in the latest version of the Content Creator Template (github) with the addition of the following package:
Currently, we have the ability to add geometry to three special artifacts: Blank Grabbable, Blank Placeable, and Blank Grounded. Each of these three artifacts has its own unique behavior:
- 1.Grabbable - an object with physics (affected by gravity) that can be picked up by hand or a pointer.
- 2.Placeable - an object without physics that can only be moved as a decorator.
- 3.Grounded - an object that automatically aligns to the ground and can only be moved as a decorator.
- 1.Download/Create the model.
- 2.Import the model into the project.
- 3.Place the model in the scene, configure it, and create a prefab.
- 4.Add a collider to the prefab, which will also handle interactions with the artifact. If you are using custom geometry (using MeshCollider) and you want this geometry to be applied to an artifact with physics (e.g., Blank Grabbable), you need to enable the Convex checkbox on the MeshCollider component.
- 5.To set the holding pose of the artifact, add the ArtifactSettings script to the prefab and enter the desired pose from the list into the HandPoseId field.
- 6.To set an offset relative to the grip point, you need to adjust the position and rotation parameters of the prefab itself.
- 7.Add the prefab to Addressables, checking the checkbox next to it.
- 8.Build the bundle for all necessary platforms.
- 9.Pack all the resulting folders into a zip archive.
- 1.Uploading the geometry data to the admin panel happens on the Geometry data tab. Here, click the "Create new" button.
- 2.Next, enter the name of the geometry data and select "Artifact" in the Kind field.
- 3.Then, load the version.
- 4.Provide a description of the version and select the zip archive.
If you plan to create multiple different artifacts from this model or export multiple different models from your project, you need to:
- Go to the Adressables Groups window and select the group into which you're adding objects (by default, this is the Default Local Group).
- Click on it and in the inspector, find the parameter "Internal Bundle Id Mode" and select "Group Guid Project Id Entries Hash."
Otherwise, they will be built with the same internal ID, and you won't be able to load them into one world.
Next, we override the name in the artifact menu.
name: Ford GT 2006
If we want to replace the icon, we upload the artifact's icon to some cloud storage and copy the link into the preview parameters.
To replace the geometry, we need to know the geometry data ID from the admin panel, the version ID of that geometry data, and the artifact's ID from the manifest.
name: Ford GT 2006
After that, save it as a file with the extension .yaml and add it to the media folder of your world (the place where we add music and pictures). If everything went well, your config will appear in the list with a green icon.
If you have a red icon, then there was an error in your file: the link to the preview is incorrect, and it cannot fetch the image, the specified geometry data does not exist, etc.
After this, the next time you enter the world, your artifact will appear in the menu (if everything went smoothly), and you don't even need to reload the world :)