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

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback