Learn how to make your own avatar attachments and fix them to your avatar.
Do you want your avatar to wear a pirate's hat? Or a pair of trousers you designed? Well, you’ve come to the right place! Customize your avatar’s appearance using the Avatar Attachments Manager in Interface. The Manager lets you upload models that can be fixed to different joints on your avatar.
Avatar attachments are models that can be fixed to your avatar. They are not entities, and cannot be scripted. While you can get plenty of avatar attachments from the Marketplace, you can also make your own to use and upload in the Marketplace.
Let’s create a Viking helmet attachment for your avatar.
You can have attachments on any type of avatar. As different avatars can have varied bone structure, ensure to use the right bones when using the attachment manager or an attachment script. We're using the default mannequin avatar as an example here.
To get this avatar, pull up your tablet in Interface and go to Market. Search for mannequin and get the default wooden avatar.
This default avatar has a custom face joint that allows you to add facial hair attachments. If you want to build your model using the avatar to see if it's a good fit, you can find the avatar's fbx file here.
Create the 3D model of the attachment you wish to see on your avatar. In this case, we created a 3D model of a viking helmet. You can use the fbx file in the link as your model.
After creating the model, you can upload it into Interface through the Avatar Attachment Manager. Before you do this, you should have identified a few important values:
In Interface, go to Menu > Avatar > Attachments.
Click New Attachment.
In the window that opens, paste your Model URL in the space provided.
Add the Joint (HeadTop_End), Translation (0,0,0), Rotation (0,0,0), and Scale (1.0) values.
The steps above will take you through creating and adding an attachment to your own avatar. Now, if you want to create a pumpkin attachment for Halloween or a wizard’s hat for the Harry Potter fan, you can create these and upload them to the Marketplace. But, you will have to upload two files to the marketplace for an attachment: the model fbx and the attachment script.
The attachment script defines the attachment, and where and how it will sit on an avatar. In other words, the values you added for joint, translation etc when you added your attachment manually through the manager, are handled by the script when downloaded through the marketplace.
This type of attacher script must be designated as the root asset when you submit to the Marketplace. When a user gets your attachment, they will have to run the script as well. This means that they won’t only be importing a model, but also be running a script to wear it as an attachment.
You can view the Marketplace submission guidelines to upload your own attachment and attacher script.
For the helmet, the script you can provide for the Marketplace is:
(function () {
'use strict';
var main = function () {
var attachment = {
modelURL: "http://mpassets.highfidelity.com/f2793a6a-8345-410a-b3bd-ebd67437ad53-v1/vikinghat.fbx",
jointName: "HeadTop_End",
translation: {"x": 0, "y": 0, "z": 0},
rotation: {"x": 0, "y": 0, "z": 0, "w": 0},
scale: 1,
isSoft: false
};
Window.alert("Wearing item as an attachment.\nTo remove or make adjustments, please use Avatar > Attachment.");
MyAvatar.attach(attachment.modelURL,
attachment.jointName,
attachment.translation,
attachment.rotation,
attachment.scale,
attachment.isSoft);
};
main();
Script.stop();
})();
Congratulations! You’ve learnt how to add a viking helmet avatar attachment and upload it to Interface using an fbx file! Now you can create your own models and follow these steps to upload your custom avatar attachments. You can even create attachments based on a theme and upload them with their attacher scripts to Marketplace for other users to enjoy.