add_camera_component
Add or configure a camera component on an actor in the editor, attaching it to a SpringArm or other scene component and applying view, projection, and post-process settings.
Instructions
Add a UCameraComponent to an actor placed in the editor world, found by name or label, optionally attaching it to a SpringArm (or any other USceneComponent) on the same actor; if the actor already has a camera component, that first one is configured instead, whatever its name, overwriting only the fields you pass. One undo step; the level is marked dirty, not saved. An invalid projection_mode or a rejected post_process_settings is an error and nothing is created or written.
Returns: { actor_name, component_name, parent_component, already_existed, applied_count, field_of_view, aspect_ratio, projection_mode, location: [x,y,z], rotation: [pitch,yaw,roll], post_process_blend_weight }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | No | Optional [X, Y, Z] relative location vs parent. | |
| rotation | No | PREFERRED: the OBJECT {"roll":R,"pitch":P,"yaw":Y} (any subset, absent axes are 0). The ARRAY form below is [pitch, yaw, roll] -- its index 2 is ROLL, NOT yaw, which once put a PlayerStart on its side. Optional [Pitch, Yaw, Roll] relative rotation vs parent. | |
| actor_name | Yes | Name or label of the target actor. | |
| ortho_width | No | Optional float. Orthographic width (only used when projection_mode = "Orthographic"). | |
| aspect_ratio | No | Optional float. Aspect ratio (e.g. 16/9). 0 = auto. | |
| b_lock_to_hmd | No | Optional bool. Lock orientation to the HMD. | |
| field_of_view | No | Optional float. Horizontal FOV in degrees (1..170). | |
| component_name | No | Optional name for a new component (defaults to "Camera"); a name another object of the actor already has gets a unique variant, returned in component_name. Ignored when the actor already has a camera component, which is configured whatever its name. | |
| projection_mode | No | Optional string. "Perspective" or "Orthographic". | |
| parent_component | No | Optional name of a USceneComponent on the same actor to attach to (e.g. "SpringArm"). Default = actor root component. | |
| post_process_settings | No | Optional object (PostProcess fields, see get_camera_post_process for the schema). | |
| post_process_blend_weight | No | Optional float. Weight of post-process (0..1). 0 means post-process disabled. | |
| b_use_pawn_control_rotation | No | Optional bool. Alias for b_use_controller_view_rotation — sets UCameraComponent::bUsePawnControlRotation. | |
| b_use_controller_view_rotation | No | Optional bool. Match pawn control rotation. |