Skip to content

1. Initial Setup

J1blCblu edited this page May 12, 2023 · 25 revisions

This page is up to date to the latest version. Previous versions may differ, but the core concepts are still the same.

Initial Character Setup

  1. Add LockOnTargetComponent to your character.

image

  1. Set TargetHandlerImplementation to ThirdPersonTargetHandler.

image

  1. Input Setup.

Input Overview.

  • Target capturing and releasing:

image

  • Target switching with an axis input:

image

Camera Setup

  1. Make sure to enable UsePawnControlRotation and EnableCameraLag in SpringArmComponent.

image image

  1. Add ControllerRotationModule to DefaultModules.

image

  1. (Optional) If you want to smoothly apply camera zoom, you can add CameraZoomModule.

image

Target Widget

  1. Add WidgetModule to DefaultModules.

image

Owning Actor Rotation

Acceptable only in standalone games. Network games require a bit more work.

  1. Add ActorRotationModule to DefaultModules.

image

  1. Add OnTargetLocked/Unlocked events from LockOnTargetComponent and disable bOrientRotationToMovement in CharacterMovementComponent if used.

image

image

Initial Target setup

  1. Add TargetComponent to the desired AActor.

image

  1. Select the mesh in TrackedMeshName, which is used for Socket lookup, Widget attachment, etc. If None then the root component will be used.

image

  1. Select the desired sockets in Sockets.

At least one socket should be specified.

image

Target Preview

  1. (Optional) If you want to preview a potential Target, you can add TargetPreview to DefaultModules.

image

Packaging Game

Be sure to read this before packaging your project.

Clone this wiki locally