RealDocs

UAbilitySystemComponent::OnRegister

function GameplayAbilities Since 4.15
#include "AbilitySystemComponent.h"
Access: public Specifiers: virtualoverride

Description

Called when the component is registered with its owning actor. The GAS override registers the component with the global AbilitySystem subsystem and sets up internal state required before gameplay begins.

Caveats & Gotchas

  • Always call Super::OnRegister() in overrides. The base implementation registers with UAbilitySystemGlobals and sets up gameplay cue proxies — omitting it leaves the component in a partially initialized state.
  • Do not call ability-activation or attribute-modification code here; the actor's world and other components may not be fully initialized yet. Use InitAbilityActorInfo or BeginPlay for that.
  • This is called before BeginPlay in the component lifecycle, so checks like HasAuthority() may not return the correct value in all configurations.

Signature

UE_API virtual void OnRegister() override;

Return Type

void

Example

Override with proper super call C++
void UMyAbilitySystemComponent::OnRegister()
{
    Super::OnRegister(); // registers with AbilitySystem globals
    // Safe: set up internal data structures or caches that don't need the world
}

Version History

Introduced in: 4.15

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.