-
-
Notifications
You must be signed in to change notification settings - Fork 59
Cosmetics
Fusion has support for Cosmetics, allowing players to customize their look further than their avatar.
In order to add your own custom Cosmetics, you can make use of the Fusion SDK and Marrow Pallets. It is recommended to have a basic understanding of Unity and the Marrow SDK before proceeding.
Before you get started, make sure you have the Fusion SDK installed in your Marrow SDK project.
If you do not have a Pallet in your project, make sure to create one. This will become the mod that stores the Cosmetics.
Cosmetics are loaded into the game as Spawnable Crates (though they will not actually be spawnable). First, select your Pallet, and click the "Avatar Crate" button:
Next, change the "Crate Type" to "Spawnable Crate":
Note that this is required because the Marrow SDK currently does not support Spawnables. If you are using the Extended SDK, you can directly use the Spawnable Crate button instead.
Finally, select the prefab you will be making the Cosmetic out of. Once you have selected it, you may create your Spawnable Crate.
Next, go to your Cosmetic prefab. You'll want to add the Cosmetic Root script to the root GameObject, like so:
Here you can change all the main settings of your Cosmetic. The settings are:
- Cosmetic Point
- This is the point on the player that the Cosmetic will attach to.
- Hidden in View
- If enabled, the Cosmetic will be invisible to the person wearing it, but visible to everyone else. It will still be visible in mirrors.
- Hidden in Shop
- This will disable the Cosmetic being available to purchase in the BitMart. This is only useful if you want to specifically reward the Cosmetic instead of making it purchasable with Bits.
- Raw Price
- This is the price in Bits that is needed to purchase the Cosmetic from the BitMart. Only necessary if Hidden in Shop is false.
- Preview Icon
- This is the icon that will be displayed in the BitMart to preview the Cosmetic.
- On the texture, make sure to turn off Generate Mipmaps. Otherwise, it may appear very low resolution due to the game's texture streaming.
- This is the icon that will be displayed in the BitMart to preview the Cosmetic.
The Cosmetic Point is the most important, as it controls where your Cosmetic goes. When the Cosmetic Point is set, a preview of the player's body will appear. For example:
Setting the Cosmetic Point to "HEAD_TOP" will show the top of the player's head, allowing you to move the mesh to align correctly.
After you have configured all your settings, you may move on to the next step.
We're almost done, but there's a few more things we need to do before Fusion recognizes the Cosmetic.
First, go back to your created Spawnable Crate:
Next, make sure to make the following changes:
- Enable "Redacted" (This will prevent the Cosmetic from appearing in the Spawn Gun)
- Add the following Tags:
- Fusion
- Cosmetic
Once you have applied these changes, you are ready to pack your Pallet and use your Cosmetics!
Some avatars may have wild proportions that cause cosmetics to be offset incorrectly. To fix this, you can use the Avatar Cosmetic Point script. Let's look at it in the editor:
In order to use this script, simply add it to a GameObject under one of your Avatar's bones. The cosmetic will move with this GameObject.
To adjust the script, you can change the following values:
- Cosmetic Point
- This controls what Cosmetic point will be overridden. For example, if you select "HEAD", then all head cosmetics will move to that point.
- Preview Cosmetic
- This won't affect anything in-game, but allows you to see how a Cosmetic would be positioned on this point. Simply select the Spawnable Crate of a Cosmetic and it will appear with a preview mesh.