Skip to content

1. Initial Setup

J1blCblu edited this page Mar 16, 2022 · 25 revisions

Setting up the plugin

  • Engine plugin - enable plugin in Edit/Plugins/LockOnTarget.
  • Project plugin - clone the repository to Project's Plugins folder. Generate project files and build Project.

Initial Character setup

  1. Add LockOnTargetComponent to your character.

image

  1. Add DefaultTargetHandler to TargetHandlerImplementation.

image

  1. Add LazyInterpolationMode in ControlRotationModeConfig.

image

  1. Update Character input.
  • Capturing and Releasing Target:

image

  • Switching Target with axis input:

image

  1. (Optional) Strafe movement.

Disable bOrientRotationToMovement if used.
image

  • If your camera doesn't have offset or not using LazyInterpolationMode

    • Clear OwnerRotationModeConfig if set.
      image

    • Set bUseControllerRotationYaw in APawn subclass or bUseControllerDesiredRotation in UCharacterMovement.
      image

  • Otherwise. If character looking a little in the wrong direction.

    • Fill OwnerRotationModeConfig with InterpolationMode/RotationModeBase.
      image
    • Choose proper axes in RotationConfig
      image

Initial Targets setup

  1. Add TargetingHelperComponent to every Target.

image

  1. Change None socket to the desired.
  2. Change MeshName to the desired (if multiple Meshes).

image

Full Setup

Clone this wiki locally