First Person Shooter Camera
Last updated
Last updated
Fisrt person shooter camera is common even in non-FPS games. With ComponentCameraSystem you can easily create a first person shooter camera using the SimpleFollow and ControlAim components.
Right click on Content Browser -> "Blueprint Class" -> create a "ECameraBase" class.
Open the class blueprint, select the "Camera Settings Component" and on the "Details" panel, expand the "ECamera" section.
Choose SimpleFollow for "Follow Component", and ControlAim for "Aim Component".
In SimpleFollow, you should first set the Socket Name property. In the official Third Person Shooter template, you can use the "neck_01" socket. Then set Follow Type to Local Space. Last you should set an appropriate follow offset, avoiding camera penetration into the model.
In ControlAim, enable Sync Yaw To Aim Target to replicate camera rotation to the aim target, so that you can use it to rotate character in accordance with camera.
Go to your character's blueprint, disable Orient Rotation to Movement in the "Character Movement" component.
In the blueprint where you want to call this camera, invoke the "CallCamera" node and pass in the "Camera Class" and "Follow Target". You MUST specify the same actor to parameter Sync Yaw To Aim Target requires the aim target not to be null. You can also specify "Blend Time", "Blend Func" and "Blend Exp" if you want smooth blending in.