How-To: Give the UI Camera Control
Goal: let a UI flow (inventory inspect, character screen, cinematic) take exclusive camera control, then hand it back.
This API is C++-only
UCrimsonUICameraManagerComponent exposes no Blueprint nodes - GetComponent, SetViewTarget, GetViewTarget, and IsSettingViewTarget are plain C++. To drive it from Blueprint, wrap the calls below in a BlueprintCallable function on your own class.Take and release control (C++)
#include "CrimsonUICameraManagerComponent.h"if (UCrimsonUICameraManagerComponent* UI =UCrimsonUICameraManagerComponent::GetComponent(MyPlayerController)){UI->SetViewTarget(MyUIViewActor); // UI takes over; the mode stack is bypassed// ... later ...UI->SetViewTarget(nullptr); // hand control back to the gameplay camera}
There is no Blueprint node for this component. Expose a thin wrapper from C++ - for example a BlueprintCallable SetUICameraTarget(AActor*) on your player controller that calls SetViewTarget - and call that from your widgets.
Client-only
UI camera view targets are a local presentation concept. Don't replicate
SetViewTarget or call it from a Server RPC - it manages visuals only.See also
- Concept: Multiplayer & Authority - why UI camera control is a local-only, non-replicated concern.
- Concept: The Mode Stack & Blending - what happens when the UI camera hands control back to the stack.