The Cosmetic API lets Verse code describe what a character wears, and change the cosmetics at runtime. The code is built from four concepts:
Concept | Type | Description |
What |
| One wearable item. Each cosmetic is a class. On Fortnite characters, outfits are |
Where |
| The slot an item goes in, such as |
Appearance |
| The entity prefab that presents the item: its mesh, name, descriptions and icon. |
Who or what wears it |
| Lives on the character entity and holds one cosmetic per category. |
A cosmetic has one prefab per style. Every cosmetic should provide a prefab for DefaultCosmeticStyle. That prefab is the cosmetic display data, the entity that the loadout spawns on the character, and the fallback for any style the cosmetic doesn't provide.
Cosmetics are referred to by class, not by instance. You declare a cosmetic as a concrete subclass and pass the class itself to the loadout. Its data is read from the class default. This is the same way Styles refers to prefabs.
The Fortnite Cosmetic API contains the following core components:
Cosmetic Prefab
Cosmetic Loadout Component
Fort Cosmetic Loadout Component
Outfit Prefabs
Outfit Templates
Cosmetic Prefab
A cosmetic_prefab is the entity prefab for a cosmetic. An outfit's prefab derives from it through an outfit template, so every outfit has these three components.
Component Name | Description | Properties |
| Marks an entity as a cosmetic. | No members of its own. |
| Component with an icon that represents a cosmetic. | Icon: A texture that represents the character in the UI. |
| Provides the name and descriptions of the cosmetic. | Name: Message containing the name field. Description: Message containing a long description. ShortDescription: Message containing a shorter description. |
Cosmetic Loadout Component
The cosmetic_loadout_component holds the cosmetic in each category for a character entity.
Member | Description |
| A map from each |
| Puts |
A few rules apply:
It spawns the prefab. The loadout adds an instance of the cosmetic's DefaultCosmeticStyle prefab as a child entity of the character, one per category. A new cosmetic with a different prefab replaces that instance. One with the same prefab keeps it. One with no default prefab removes it.
The authored loadout applies on add. When the component is added to the scene, it calls SetCosmetic for each authored entry, so authored cosmetics take the same path as runtime changes.
No failure context SetCosmetic has no effect specifiers, so call it after an if condition, not inside of one.
The base component only records the change and spawns the prefab. On Fortnite characters, fort_cosmetic_loadout_component also dresses the character.
Fort Cosmetic Loadout Component
The fort_cosmetic_loadout_component is the loadout component on Fortnite characters and requires a linked Fortnite character.. It takes the same SetCosmetic call, spawns the prefab the same way, and also dresses the linked Fortnite character in the outfit, using the full Fortnite character customization.
Member | Description |
| Inherited. Puts the cosmetic in the category and dresses the character when the cosmetic is a Fortnite outfit. |
| Inherited. The cosmetic class in each category. Read-only. |
| The bounds of the editor preview of the outfit, in world space. Not valid in game worlds. |
| The bounds of the editor preview of the outfit, in local space. Not valid in game worlds. |
The following table details how the fort_cosmetic_loadout_component dresses the character:
Behavior | Description |
Server only | The outfit is applied on the server. Clients see it through the character's replicated customization. |
Outfits only | Only a Fortnite outfit set in |
Same outfit does nothing | Setting the outfit the character already wears doesn't rebuild the character. |
Players | The player is re-dressed in place. The outfit is an override on top of the player's own loadout, which isn't changed. It belongs to the character it was set on and ends with that character, so a player who respawns comes back in their own outfit. To keep the outfit, set it again after the player respawns. It never changes the player's locker. |
NPCs | An NPC spawned by a |
Player-style pawns only | Only NPCs that spawn as player pawns can wear outfits. AI pawns, such as wildlife, ignore the change and log a warning to use spawn data that spawns a player pawn. |
Editor preview | In the level editor and the prefab editor, the entity shows a preview mannequin wearing the outfit. The mannequin is never saved and isn't part of the undo process. |
Outfit Prefabs
The fort_outfit_cosmetic_prefab is the prefab for a Fortnite outfit. It's a fort_cosmetic_prefab, which is a cosmetic_prefab whose cosmetic component is a fort_cosmetic_component. You don't construct it directly, and it's hidden in the editor, because a prefab based on it directly has no body type. Base your prefab on one of the outfit templates in the prefab editor instead.
Component | Description |
| The |
| A |
| Inherited from |
The pose is copied from the Fortnite character to the outfit's mesh by bone name. Bones that match the Fortnite skeleton follow the character, and other bones stay in their reference pose.
Outfit Templates
The outfit templates are the starting point for a custom outfit. Each one is a public fort_outfit_cosmetic_prefab for one body type. To make an outfit, base a prefab on a template in the prefab editor and swap its mesh_component for your mesh. Declare an outfit class in Verse that derives from fort_outfit_cosmetic and points at your prefab, then compile Verse.
Template | Body type |
| Medium, masculine reference skeleton ( |
| Medium, feminine reference skeleton ( |
| Large, masculine reference skeleton ( |
| Large, feminine reference skeleton ( |
Each template sets the character's body type, and a prefab you base on it inherits that body type. The template's mesh is a placeholder cube that you replace with your own. Every custom outfit class derives straight from fort_outfit_cosmetic, whichever template its prefab is based on.
To learn how to create custom outfits, see Outfits with the Cosmetic API.
Known Issues and Experimental Limitations
The following are known issues:
An outfit prefab must be made in the prefab editor. You can't declare one in Verse, so each new outfit takes an editor step, a Verse class and a Verse compile before you can use it.
The outfit is the only category that changes a Fortnite character in 44.0.
There's no event when a cosmetic changes.
You can't add a
fort_cosmetic_loadout_componentto a character yourself. Use a character that already has one, such as a player or an NPC made fromguard_template. Theguard_templateitself is still@experimental.An outfit set on a player ends when the player respawns and their own outfit comes back. Set it again after each respawn to keep it. You can't clear an outfit with SetCosmetic. To get a default look before the player respawns, set a stand-in outfit.
NPCs that spawn as AI pawns, such as wildlife, can't wear outfits.
A custom outfit has a single
mesh_component. Outfits made of several meshes aren't supported.Only bones whose names match the Fortnite skeleton follow the character. Other bones stay in their reference pose.
Custom outfits don't support facial animation.
Example
This snippet dresses a character when the game starts. Add it to the root entity of an NPC template that has a fort_cosmetic_loadout_component. The NPC's current pawn is re-dressed, and later spawns wear the outfit.
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Characters/Cosmetics/Outfits }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
# Dresses the NPC on this entity in my_outfit when the game starts.
npc_outfit_component := class<final_super>(component):
OnBeginSimulation<override>():void =
(super:)OnBeginSimulation()