Manuals of ComponentCameraSystem
  • Introduction
  • Basic Uses
    • General Workflow
    • Working with Sequencer
    • Third Person Camera
    • Lock-On Camera
    • Camera Shake
    • Camera Postprocessing
    • Camera Lens Effect
    • Camera Dither Fade
    • Photo Mode (Experimental)
    • Other Features
    • FAQ
  • Advanced Uses
    • Change Component Properties at Runtime
    • Customizing Camera Components
      • Customizing ECameraComponentFollow, ECameraComponentAim and ECameraExtensionBase
      • Customizing Existing Components: ControlAim as An Example
      • Customizing ECameraGroupActorComponent
      • Customizing ECameraHUD
      • Customizing EPlayerCameraManager
    • Camera Dampers
    • Animating Camera
    • Mixing Camera
    • Sequenced Camera
    • Keyframing Camera
    • ArchViz Camera
    • Integrating with Montage
    • Integrating with Gameplay Ability System (GAS)
  • Showcases
    • Boss Battle Camera
    • Group Aim Camera
    • Orbit Camera
    • Rail Camera
    • Crane Camera
    • Third Person Framing Camera
    • First Person Shooter Camera
    • Pseudo First Person Shooter Camera
    • Static Camera
    • Only Follow Camera
    • Only Aim Camera
  • Camera Components
    • Follow Components
      • ScreenFollow
      • SimpleFollow
      • HardLockFollow
      • OrbitFollow
      • RailFollow
      • CraneFollow
    • Aim Components
      • TargetingAim
      • HardLockAim
      • ControlAim
    • Extension Components
      • ResolveOcclusionExtension
      • MixingCameraExtension
      • ConfinerExtension
      • ResolveGroupActorExtension
      • AnimatedCameraExtension
      • KeyframeExtension
      • ConstrainPitchExtension
      • ModifyAimPointExtension
      • VelocityBasedRollingExtension
    • Miscellaneous
      • Photo Camera
      • Animated Camera
      • Keyframed Camera
      • ArchViz Camera
      • ArchViz CineCamera
      • ArchViz Camera Component
      • ArchViz CineCamera Component
      • Sequenced Camera Actor
      • Group Actor Component
      • CameraModifier_CameraShake
      • PCMGNeuralNetwork
      • ECamera Shake Source Actor
  • Blueprint Nodes List
    • ECameraBase
    • ECameraSettingsComponent
    • EPlayerCameraManager
    • ECameraLibrary
    • ECameraGroupActorComponent
    • RailFollow
    • ScreenFollow
    • ControlAim
    • MixingCameraExtension
    • VelocityBasedRollingExtension
  • Code Framework
    • Code Framework
  • Changelog
    • Changelog
      • V0.1.x
      • V0.2.x
Powered by GitBook
On this page
  1. Advanced Uses

Mixing Camera

PreviousAnimating CameraNextSequenced Camera

Last updated 1 year ago

Sometimes it is very useful to blend multiple cameras and dynamically adapt their weights to runtime properties. For example, when you are fighting against a boss, you can use two lock-on cameras, one for where you're close to the boss and the other for where you are at a far place, with their weights adjusted according the distance between you and the boss. This is particularly useful as you might want to present different views when you are near or far from the target, which is common in most 3A games.

Before going on, make sure you know what is and its tunable parameters.

The easist way to call a mixing camera is to use the CallCamera node in blueprint, as most other cameras do. But before that, you should first create a mixing camera using the MixingCameraExtension and create its sub-camera blueprints. Reference the following instructions to call a mixing camera.

  1. Create a mixing camera. Right click on content browser, select "Blueprint Class", search for "ECameraBase" and click "Select". Add a MixingCameraExtension extension to it. You can also add a resolve occlusion extension. By doing this, you create a new mixing camera. Rename it as whatever you want, for example "MyMixingCamera".

  2. Create sub-cameras. Right click on content browser, select "Blueprint Class", search for "ECameraBase" and clike "Select". This is the sub-camera class you will add to the mixing camera you just created in step 1. Rename it as whatever you like, for example "LockCamera1". You can create multiple sub-cameras using the same step here, but remember to only inherit the "ECameraBase" class.

  3. Set up your sub-cameras. Add optional follow component, aim component and extensions to each of your sub-cameras. For example, here I set each sub-camera as a lock-on camera, i.e., ScreenFollow + TargetingAim but with different parameters.

  4. Go back to your mixing camera, and assign sub-cameras in the mixing camera extension. You can optionally assign follow target and aim target if your sub-camera requires one. You must use approriate Weight Update Scheme and Mix Scheme to make sure the mixing camera behaves in a way you expect. Note that you can also specify the follow component / aim component of this mixing camera. If you do so, it will override the location / rotation returned by sub-cameras if the execution order is approriately set.

  5. The final step is go to where you want to call this mixing camera and use the CallCamera node. If you specified a follow component or an aim component, you may need to provide a follow target or aim target to the corresponding pin.

  6. Now you can see the mixing camera blends between the sub-cameras in viewport.

Notes

  1. The idea is very simple: use the distance between the follow target the aim target of each sub-camera as the raw weight, and then normalize them via the NormalizeWeights node, the result of which is fed into the final weights. As I expect a larger weight with a closer distance, I use the reciprocal of the raw distance to make up the un-normalized weight array. It looks like a little complicated, but the process is very lucid and is highly customizable.

  2. You should be very careful of mixing camera rotation because it may produce very unpleasant rotation jumps. It's recommended to set the same aim target for each sub-camera, if necessary, or just override the mixing camera's aim component. If you do need to mixing different rotations from different look-at actors, be sure to use the Eigenvalue mix rotation method.

For most of the time, you will need the Manual mode for Weight Update Scheme. To this end, you should assign the weights in the Tick event of the mixing camera blueprint, by leveraging the built-in node GetSubCameraOfClass, GetSubCameraOfIndex, NormalizeWeights and SetWeights. Refer to for complete introductions to these nodes. An example is shown below.

MixingCameraExtension
MixingCameraExtension