Skip to content

Component profile API reference

This page documents the shared UMotionComponentProfile contract. The Motion walk, sprint, crouch, jump, breathing, movement sound, and camera profiles use this contract. For the authoring workflow, see Component profiles.

Profile role

UMotionComponentProfile is the UPrimaryDataAsset base class for Motion component defaults. Components validate profiles during setup and copy applicable component-owned runtime values. Profile assignment is not a live loadout swap.

Metadata fields

FieldTypeContract
ProfileIdentifierFNameStable identifier for the authored profile. It must be set, but it does not participate in primary asset identity.
DisplayNameFTextLocalized label for editor UI, diagnostics, and tooling. It must be non-empty.
DescriptionFTextOptional localized description. An empty description is a warning, not an error.

Read APIs

FunctionReturnsUse
ValidateProfile(TArray<FMotionProfileValidationMessage>& OutMessages)boolValidates the base profile details and the subclass-specific profile fields.
GetPrimaryAssetId()FPrimaryAssetIdReturns a primary asset ID. The type is the concrete profile class name. The name is the profile asset object name. Profiles can share ProfileIdentifier. Different asset object names produce different asset IDs.

Read DisplayName, Description, and ProfileIdentifier directly to get profile details in tooling.

Validation messages

ValidateProfile writes diagnostics into FMotionProfileValidationMessage:

TypeFields or values
EMotionProfileValidationSeverityError, Warning
FMotionProfileValidationMessageSeverity, Message

Severity defaults to Error. Message is an FText so validation output can be displayed in localized editor and Blueprint-facing tools.

ValidateProfile clears OutMessages at the start of each call. Then, it adds validation messages for the current profile. It returns false when one or more messages have EMotionProfileValidationSeverity::Error. The function returns warnings to the caller, but warnings do not make the profile invalid.

The base UMotionComponentProfile validation rules are:

RuleSeverity
ProfileIdentifier is NoneError
DisplayName is emptyError
Description is emptyWarning

Profile subclasses add behavior-specific checks. Examples include necessary GameplayEffect references, necessary curve assets, numeric limits, and warnings for runtime playback state in authored FMotionCurve values.

Example validation check

cpp
TArray<FMotionProfileValidationMessage> Messages;
const bool bValid = Profile->ValidateProfile(Messages);

for (const FMotionProfileValidationMessage& Message : Messages)
{
    const TCHAR* SeverityText =
        Message.Severity == EMotionProfileValidationSeverity::Error
            ? TEXT("error")
            : TEXT("warning");

    UE_LOG(LogTemp, Log, TEXT("Profile %s: %s"),
        SeverityText,
        *Message.Message.ToString());
}

if (!bValid)
{
    // Block setup or disable the affected behavior.
}

Components use the same error and warning difference when they do a check of assigned profiles. Errors block a valid setup. Warnings remain visible diagnostics.

Motion - Advanced First Person Character Controller