Creating Cosmetic Item Variants - Epic Wiki

# Creating Cosmetic Item Variants

# Contents

# Overview

You may want to support having several variants of a cosmetic item, but the variants aren't major enough to warrant having a separate item for each one. For example, you may have a cap that you want to allow players to make blue, green or yellow, but making them acquire each individual hat would be overkill. We've implemented a variant system to solve this problem. There are simple variants that just swap colors in your materials and complex variants that have full blueprint support for you to implement whatever you can dream up.

# Simple Variants

The simplest form of cosmetic variant is a color swap. The cosmetic system supports setting two named vector material parameters, "CosmeticColor1" and "CosmeticColor2".

My material looks like so:

Material.png

You then add to the Variant Names array in cosmetic blueprint. We automatically add a variant called default to the customization drop down in-game, so make sure you account for that when modifying the Variant Color Swaps array. Note that I have 3 Variant Names and 4 Variant Color swaps in the image below. Variant Color Swaps index 0 will be the default color scheme.

CosmeticvariantBlueprint.png

# More Complex Variants

There's a blueprint event that you can implement in your cosmetic blueprint named "On Variant Selected". It will have an integer called "Variant" that signals your cosmetic that the player has chosen a non-default variant. If you are using this method, it is not necessary to fill out Variant Color Swaps. If you would like color swaps in addition, make sure that you have a call to the parent function like the below image (Compile the blueprint, then right click the event node and select Add Call To Parent Function).

Callparent.png

# Testing In Game

Open the Player Settings menu. Select your custom cosmetic and an extra dropdown will appear if Variant Names array has any items in it. Selecting an item in the Variant dropdown will update the live preview with your changes.

Playersettings.png

Retrieved from "https://wiki.unrealengine.com/index.php?title=Creating_Cosmetic_Item_Variants&oldid=12980"

Categories: