Skip to content

1. Initial Setup

J1blCblu edited this page Oct 31, 2023 · 25 revisions

This page is up to date to the latest version.

Previous versions
Plugin Version Supported Unreal Versions
1.6.x 5.1-5.3
1.5.x 5.1-5.2
1.4.x 5.0-5.1
1.2.x 4.26-5.0

Initial Character Setup

  1. Add LockOnTargetComponent to your character.

image

  1. Set TargetHandlerImplementation to WeightedTargetHandler.

image

  1. Input Setup.

Detailed Input Overview.

  • Target finding and clearing:

image

  • Target switching with an axis input:

image

LockOnTargetComponent is just a storage for the captured Target, additional features are implemented inside Extensions, even Target finding. To add a particular Extension, you should add it to the Default Extensions property.

image

Camera Setup

By default, LockOnTarget uses Controller rotation to orient the camera to the Target.

  1. Add ControllerRotationExtension.

image

  1. Make sure to enable UsePawnControlRotation in SpringArmComponent.

image

  1. To enable camera location lag, activate EnableCameraLag in SpringArmComponent.

image

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

image

Target Widget

  1. To visually indicate the Target, add WidgetExtension.

image

image

Pawn Rotation

LockOnTarget doesn't provide any strafing animations.

  1. To orient the character to face the Target, add PawnRotationExtension.

image

  1. If you're using bOrientRotationToMovement in CharacterMovementComponent, add OnTargetLocked/Unlocked events from LockOnTargetComponent and disable it.

image image

image

Initial Target Setup

  1. Add TargetComponent to the desired AActor.

image

  1. Select the mesh in AssociatedComponentName, which is used for Socket lookup, 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 TargetPreviewExtension.

image

Packaging Game

Warning Be sure to read this before packaging your project.

Clone this wiki locally