UWorld::SpawnPlayActor

Spawns a PlayerController and binds it to the passed in Player with the specified RemoteRole and options

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/World.h

Include

#include "Engine/World.h"

Source

/Engine/Source/Runtime/Engine/Private/LevelActor.cpp

Syntax

APlayerController * SpawnPlayActor
(
    class UPlayer * Player,
    ENetRole RemoteRole,
    const FURL & InURL,
    const FUniqueNetIdRepl & UniqueId,
    FString & Error,
    uint8 InNetPlayerIndex
)

Remarks

Spawns a PlayerController and binds it to the passed in Player with the specified RemoteRole and options

Returns

the PlayerController that was spawned (may fail and return NULL)

Parameters

Parameter

Description

Player

the Player to set on the PlayerController

RemoteRole

the RemoteRole to set on the PlayerController

URL

URL containing player options (name, etc)

UniqueId

unique net ID of the player (may be zeroed if no online subsystem or not logged in, e.g. a local game or LAN match)

Error

(out) - if set, indicates that there was an error - usually is set to a property from which the calling code can look up the actual message

InNetPlayerIndex

(optional) - the NetPlayerIndex to set on the PlayerController

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss