Project

General

Profile

Customizing characters through blueprints

What is the HowTo about?

In this HowTo, we’re going to build a blueprint to change some player’s pawn parameters.

What assets are needed?

All the assets from the basic custom object HowTo.

Steps

Reaching the Customizable Object Instance

1 - Open the Level Blueprint.


2 - In an empty area, add the following nodes. This blueprint nodes will, when the user presses the “K” key, take the player controller number 0, which in this case is the current single user, obtain the player controller’s assigned pawn, and cast it to a MutableGameCharacter type, in order to access some variables we need for our example.


3 - From this casted MutableGameCharacter, we can now access the CustomizableSkeletalComponent.


4 - A node of type Customizable Object Instance is going to be needed as well.


Using the Customizable Object Instance to set customized parameters

Now, let’s add some parameter customization nodes so we can change our character appearance. A set of blueprint nodes are available to easily change any parameter for any character using Mutable. Below is a small description of the functionalities of those nodes.

Node to set an option for an integer parameter. The “Param Name” field is the name of the integer parameter (for instance, "Beards", "Moustache" or "Trousers"). The “Selected Option Name” is the available option for the integer parameter specified in “Param Name” to be set. For example, in the case of the "Beards" parameter, there’s one beard option named "Shield".   Node to set a value for a float parameter. This node is easier to use: just place in “Float Param Name” the name of the float parameter that needs to be changed, and in “Float Value” the float value to set, taking a value in the [0.0, 1.0] interval. For example, there are float parameters named “Hair Color” and “Head Shape”.   Node to set a value for a boolean parameter. Works equivalently to the float parameter node: put in “Bool Param Name” the name of the Bool parameter to change, and in “Bool Value” the boolean value to set (mark or unmark the squared box). For example, there’s a bool parameter named “Jowl”.
   

There are nodes to change vector and projector parameters available, but we won’t use them in this example since there’re no vector nor projector parameters in the Mutable Village demo. In order to have Mutabe know an update of the skeletal mesh of the character has to be done, use the node “Update Skeletal Mesh Async”. The “Async” means the update will be done asynchronously, to avoid blocking the game while performing all the corresponding computations.


5 - Extend the current blueprint to complete an example like the one below.

Result

Play the Mutable demo from the editor and press the “K” key. The parameters of the player’s controlled will be updated.