unreal.GameInstance

class unreal.GameInstance(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

GameInstance: high-level manager object for an instance of the running game. Spawned at game creation and not destroyed until game instance is shut down. Running as a standalone game, there will be one of these. Running in PIE (play-in-editor) will generate one of these per PIE instance.

C++ Source:

  • Module: Engine

  • File: GameInstance.h

Editor Properties: (see get_editor_property/set_editor_property)

  • on_input_device_connection_change (OnUserInputDeviceConnectionChange): [Read-Write] Callback for when an input device connection state has changed (a new gamepad was connected or disconnected)

  • on_pawn_controller_changed_delegates (OnPawnControllerChanged): [Read-Write] gets triggered shortly after a pawn’s controller is set. Most of the time

    it signals that the Controller has changed but in edge cases (like during replication) it might end up broadcasting the same pawn-controller pair more than once

  • on_user_input_device_pairing_change (OnUserInputDevicePairingChange): [Read-Write] Callback when an input device has changed pairings (the owning platform user has changed for that device)

handle_network_error(failure_type, is_server) None

Opportunity for blueprints to handle network errors.

Parameters:
handle_travel_error(failure_type) None

Opportunity for blueprints to handle travel errors.

Parameters:

failure_type (TravelFailure) –

property on_input_device_connection_change: OnUserInputDeviceConnectionChange

[Read-Write] Callback for when an input device connection state has changed (a new gamepad was connected or disconnected)

Type:

(OnUserInputDeviceConnectionChange)

property on_pawn_controller_changed_delegates: OnPawnControllerChanged

[Read-Write] gets triggered shortly after a pawn’s controller is set. Most of the time it signals that the Controller has changed but in edge cases (like during replication) it might end up broadcasting the same pawn-controller pair more than once

Type:

(OnPawnControllerChanged)

property on_user_input_device_pairing_change: OnUserInputDevicePairingChange

[Read-Write] Callback when an input device has changed pairings (the owning platform user has changed for that device)

Type:

(OnUserInputDevicePairingChange)

receive_init() None

Opportunity for blueprints to handle the game instance being initialized.

receive_shutdown() None

Opportunity for blueprints to handle the game instance being shutdown.