RealDocs

APlayerState::SetIsFromPreviousLevel

function Engine Since 4.0
#include "GameFramework/PlayerState.h"
Access: public

Description

Sets the bFromPreviousLevel flag without triggering replication side effects. Used after consuming the flag value to prevent duplicate processing on subsequent logins.

Caveats & Gotchas

  • • This setter bypasses normal replication callbacks — it writes the member directly. If you need clients to be aware of the change, handle replication manually or rely on existing OnRep logic.
  • • The flag is not networked by itself; it is populated server-side during seamless travel. Calling this on a client has no effect on authority state.

Signature

ENGINE_API void SetIsFromPreviousLevel(const bool bNewFromPreviousLevel)

Parameters

Name Type Description Default
bNewFromPreviousLevel const bool The new value to assign to the bFromPreviousLevel flag. —

Return Type

void

Example

Clear the flag after processing C++
if (PS->IsFromPreviousLevel())
{
    HandleLevelTransition(PS);
    PS->SetIsFromPreviousLevel(false); // prevent re-processing
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable —

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.