General Workflow
Last updated
Last updated
To put it simply, you only need to take three steps: preparations, combining camera components and calling the camera in blueprint.
Before using ComponentCameraSystem, you must do some preparation work first.
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 the Player Controller Class
parameter of World Settings
.
Specifically, open the World Settings
windows, locates to Game Mode
, open the Player Controller Class
blueprint, and change the value of Player Camera Manager Class
to EPlayerCameraManager
. 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 raw PlayerController
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 the HUD Class
parameter of World Settings
.
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 initializing Rotation
as follows. For efficiency consideration, you can create a new variable of type APlayerController*
and store the casted result into it.
If you are working on a Blueprint project, you can follow the same procedure but in a pure blueprint manner.
I strongly recommend you copy and modify the source code of EPlayerCameraManager
and ECameraHUD
to meet your needs.
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 a CameraComponent
and a CameraSettingsComponent
.
Click the CameraSettingsComponent
and in the Details
panel you will see the parameters under the ECamera
group, i.e., Follow Component
, Aim Component
and Extensions
.
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.
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!