unreal.GameplayViewTargetPolicy

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

Bases: Object

A gameplay view target policy determines which player controller should change its view target when gameplay is started, e.g. PIE or in shipped games.

Some output providers, such as pixel streaming, require the view target to be set to the cine camera

C++ Source:

  • Plugin: VirtualCameraCore

  • Module: VCamCore

  • File: GameplayViewTargetPolicy.h

determine_player_controllers(params) Array[PlayerController]

Called when the policy should be applied: when the output provider’s activation changes in a game world.

Parameters:

params (DeterminePlayerControllersTargetPolicyParams) –

Returns:

The player controllers for which the view target should be set to the output provider’s camera. Typically contains 1 element but you can return more if you wish.

Return type:

Array[PlayerController]

update_view_target(params) None

Called to just after the view target has been updated for the player controller that was previously returned by DeterminePlayerController.

The default implementation sets the view target without a blend. You can override this to do a blend or perform additional actions. Note this is also called when the the owning output provider is deactivated (so you can possibly reset the view target to be the old player controller’s pawn).

Parameters:

params (UpdateViewTargetPolicyParams) –