This component enables in-game editor functionality with Widget Blueprints, the Camera Studio, and the Light Studio.
It must be added to the same Blueprint, that already has a BP_CharacterCustomization component.
This component does not work on its own.
Since the V11 Gameplay Tag Update this component works with Pawn-based Blueprints. Before, it only worked with Character-based Blueprints. In this page we mostly refer to pawns from now on.
Since the V6 Replication Update, in addition to the previous component there is minor replication in this component as well. It got the new Function: Initialize From Character Begin Play specific to BP_Character ➝ Begin Play and the new Event: Initialize (Replicable), which is called from within the function.
This function is the entry point from within our BP_Character or your own Pawn-based Blueprint. Thus, think back to chapter BP_Character ➝ Begin Play, where you saw when it was called.
This function binds to the new On Initialized dispatcher of the BP_CharacterEditor component, which can be used in the Pawn Blueprint. The function then calls Event: Initialize (Replicable).
Depending on the pawn instance that calls Function: Initialize From Character Begin Play this event in turn has either a server-side or client-side path.
The server is checks for Is Player Controlled while the client checks for Is Locally Controlled. This is because joining clients have one or more frames during joining where Is Player Controlled is not true for them, as the game still needs to replicate the character possession. Relying on Is Locally Controlled is fine for clients, since other local characters are controlled by the server, thus only the player pawn is locally controlled.
Checking one of these properties is necessary to avoid spawning/initializing a Character Editor for uncontrolled characters, i.e. NPCs. After those checks, we finally call Event: Initialize.
[V10] Since V10 Selection Update both paths also check for Initialize If Uncontrolled to optionally initialize the component, even if the pawn is not controlled, yet. E.g., BP_CE_Demo_CharacterBase_CC_CE of the standalone demo does this, where multiple characters get initialized, waiting for them showing their character editor widget during play.
This event takes the input Show Editor, which is passed down to Event: Proceed With Loaded CDAs as you can see in the screenshot. Focusing on the current event itself, it first validates the Character Customization component of the owning character. Then:
Once all available Customization Data Assets are loaded, the initialization can proceed.
It creates the idle widget:
It creates the Character Editor widget
Finally, the Character Editor will be either opened or closed by default, depending on Show Editor that was passed through Event: Initialize.
This event shows the editor, changes the player’s input mode, show the mouse cursor, enables BP_CameraStudio and initializes the BP_LightStudio with a given profile.
[V5] Afterwards, OnOpen is called if you desire binding on it.
This event reverts all the opening steps.
[V5] Afterwards, OnClosed is called if you desire binding on it.