UActorComponent::IsNetSimulating
#include "Components/ActorComponent.h"
Access: public
Specifiers: inline
Description
Returns true when this component is replicating and the local machine does not have authority over it (i.e. the owning actor's role is not ROLE_Authority). Equivalent to checking both GetIsReplicated() and GetOwnerRole() != ROLE_Authority.
Caveats & Gotchas
- • Returns false on listen-server clients that own the actor, even though those clients see other players' replicated components — always check the specific actor's role, not just IsNetSimulating(), if you need to distinguish listen-server host from dedicated server.
- • A component on a standalone (offline) game always returns false because GetOwnerRole() is ROLE_Authority by default; guard any net-sim code with this before checking other network state.
Signature
bool IsNetSimulating() const; Return Type
bool Example
Skip server-only logic on simulated proxy C++
void UMyNetComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (IsNetSimulating())
{
InterpolateState(DeltaTime);
}
else
{
SimulateAuthoritativeState(DeltaTime);
}
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?