UGameplayStatics::GetPlayerCameraManager
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the APlayerCameraManager for the player controller at the given index. The camera manager controls view targets, camera shakes, and post-process effects applied per-player.
Caveats & Gotchas
- • Returns null for remote players on a client — only local player controllers have accessible camera managers on a given machine.
- • The camera manager is owned by the player controller and is only valid after the controller is fully spawned; calling this too early during level load may return null even for player index 0.
- • Modifying camera properties through the manager (e.g. AddNewCameraModifier) only affects the local view; it has no network replication.
Signature
static ENGINE_API class APlayerCameraManager* GetPlayerCameraManager(const UObject* WorldContextObject, int32 PlayerIndex); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to retrieve the world context. | — |
| PlayerIndex | int32 | Index in the player controller list (0 for the primary local player). | — |
Return Type
APlayerCameraManager* Example
Play a camera shake on the primary player C++
APlayerCameraManager* CamMgr = UGameplayStatics::GetPlayerCameraManager(this, 0);
if (CamMgr)
{
CamMgr->StartCameraShake(UExplosionShake::StaticClass(), 1.0f);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?