General Workflow
To put it simply, you only need to take three steps: preparations, combining camera components and calling the camera in blueprint.
Preparations
Before using ComponentCameraSystem, you must do some preparation work first.
(Optional) Add an
ECameraManager
actor into the level. On to top tool bar, click "Add"->"All Classes"->"ECamera Manager". Drag it into the level regardless of its position. (Now this step can be skipped. When you run your project, this actor will be automatically added into the level if you do not add it in advance.)(Mandatory) EaseCamera has many internal functionalities for easy configurations associated with cameras, such as post processing, object fading. photo mode (coming soon), etc. To use these functionalities, you must set up a
EPlayerCameraManager
class in thePlayer Controller Class
parameter ofWorld Settings
. Specifically, open theWorld Settings
windows, locates toGame Mode
, open thePlayer Controller Class
blueprint, and change the value ofPlayer Camera Manager Class
toEPlayerCameraManager
. Note that if you are using a C++ project instead of a blueprint project, you probably need to create a new player controller class inherited from the rawPlayerController
class and assign it to game mode.(Optional) If you want to enable debug visualization at runtime, you must set up a
ECameraHUD
class in theHUD Class
parameter ofWorld Settings
.(Mandatory) Let your character move according to camera orientation instead of control rotation. If you are working on a C++ project, you should remove the camera component and spring arm component in the default character class, i.e., remove all the code within the red area as shown below.
Then go to the
Move
function, and change the line of code initializingRotation
as follows. You should include theKismet/GameplayStatics.h
header file to enclose theGetPlayerCameraManager
function.If you are working on a Blueprint project, you can follow the same procedure but in a pure blueprint manner.
If you are working on a large commercial project, I strongly recommend you copy and modify the source code of EPlayerCameraManager
and ECameraHUD
to meet your needs.
Using Different Camera Components to Create Camera Behaviours
Once you have finished the above preparation work, you can set out to create your cameras by following the next steps.
Create a new camera class. In the content browser, right click and select "Blueprint Class", then search for "ECameraBase" and click "Select".
Open the blueprint class you just created, you will see on the top left
Components
tab aCameraComponent
and aCameraSettingsComponent
.Click the
CameraSettingsComponent
and in theDetails
panel you will see the parameters under theECamera
group, i.e.,Follow Component
,Aim Component
andExtensions
.Each parameter requires you to fill in a camera component, which defines how this camera actor moves and rotates. You can play with these built-in components and change their inner parameters to see how they control the camera. A complete explanation of all components can be found at Camera Components. Or you can customize your own camera components, for which you can refer to Customizing Camera Components.
Calling the Camera in Blueprint
Once you complete your camera, you can call it in blueprint whenever you want. The blueprint node you are using to call the camera is CallCamera. It can receive many parameters, and the most important ones are Camera Class
, Follow Target
, Aim Target
and Blend Time
. A complete explanation of the CallCamera
node is given in the Blueprint Nodes List section.
Camera Class: the camera you are calling. You should specify a valid camera class for this parameter, otherwise this node will not work properly.
Follow Target: the target actor for the follow component. Generally, this is the actor your camera is tracking.
Aim Target: the target actor for the aim component. Generally, this is the actor your camera is looking at.
Blend Time: the time to blend from existing active camera to the called camera. A value of larger than zero makes the camera transition smoothly between cameras, but the optimal value should be tuned according to different use cases.
Besides CallCamera, you can also use the CallCameraWithSceneComponent node to attach the camera to scene components. But you should assure the scene component should match the target you feed in. If you want to just alter current camera's follow target/aim target/follow socket/aim socket/follow scene component/aim scene component, you can use the SetFollowAndAimWithBlend node without creating a new camere blueprint class.
Now, compile and save the blueprints. Just click "Play" and enjoy your great camera creation!
Last updated