RealDocs

UAbilitySystemComponent::CacheIsNetSimulated

function GameplayAbilities Since 4.20
#include "AbilitySystemComponent.h"
Access: public

Description

Caches the current net simulated/authority flags on the component so that frequently called GAS internals can read them cheaply without re-evaluating actor net role each time.

Caveats & Gotchas

  • This is an engine-internal performance optimization. You generally should not call it directly — it is called automatically at the right points in the replication and possession lifecycle.
  • If you override possession or replication initialization in unusual ways and observe incorrect HasNetAuthority() behavior inside abilities, consider whether CacheIsNetSimulated() was missed in your flow.
  • The cached value becomes stale if the owning actor's net role changes after initialization (e.g., in unusual listen-server role-swap scenarios). Inspect bCachedIsNetSimulated in those edge cases.

Signature

UE_API void CacheIsNetSimulated();

Return Type

void

Example

Called automatically — informational context only C++
// You normally don't call this directly.
// It is invoked inside InitAbilityActorInfo and replication callbacks.
// Example: if building a custom ASC init flow, call it after setting up the owning actor:
void UMyAbilitySystemComponent::CustomInit(AActor* Owner, AActor* Avatar)
{
    InitAbilityActorInfo(Owner, Avatar); // calls CacheIsNetSimulated internally
}

Version History

Introduced in: 4.20

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.