Ninja Bear Studio Plugins Help

Configure the Target Lock

The Target Lock Ability helps with camera focus, precision and add visual indicators to a target. This system uses Unreal Engine's Gameplay Targeting System to collect targets.

Create a Targeting Preset

  1. Create a new Targeting Preset. It will be used for the target selection.

  2. Add the Camera Selection Task. You can use its default values or adjust them as you like.

  3. Add the AOE Selection Task. Use a Sphere shape, add Pawn and World Dynamic as Collision Object Types, set it to ignore the source actor and instigator, and a radius of 1600.

  4. Add the Actor Class Filter Task. Set your base Character Class as the Required Actor Class Filter, or adjust these filters to match your character hierarchy.

  5. Add the Facing Filter Task. Set the maximum angle to 60, or any other value that makes sense to you.

  6. Add the Dead Filter Task.

  7. Add the Sort By Distance Filter Task.

Targeting Preset

Configure the Target Lock Ability

  1. Create a new Gameplay Ability using CombatAbility_TargetLock as the base class.

  2. Set the Targeting Preset that was created in the step above.

  3. Disable Move to New Targets for now, but feel free to explore this if you'd like.

  4. Set the Distance Threshold to 1600, or any other value that makes sense to you. This will disengage from the target, if the distance from the avatar exceeds this value.

  5. Add this Gameplay Ability to the list of Default Abilities added to the player.

Targeting Preset

Create a Target Lock Widget

  1. Create a new User Widget using NinjaCombatBaseWidget as the base class.

  2. Add an Image component, using any marker that you'd like.

Targeting Preset

Create a Marker Actor

  1. Create a new Blueprint using NinjaCombatMarkerActor as the base class.

  2. Add the widget created in the previous step to this actor's Target Lock Widget Component.

  3. Set the new Blueprint to your player character, in its Combat Manager Component, in the Target Marker Actor Class.

Targeting Preset

Configure the enemy anchor

  1. In your Base Character (or Base Enemy Blueprint), add a new Scene Component under the main Character Mesh.

  2. Set this component's location where the Marker Actor should be attached.

  3. Add the Combat.Component.TargetLockAnchor tag to the component.

Configure the Target Lock Input

  1. Create a new Input Action for the Target Lock input. Add a Pressed trigger to it.

  2. Add the new Input Action to your Input Mapping Context asset, mapping it to an appropriate key.

  3. Create a new Input Handler or add one directly to your Input Setup, using the Activate Ability by Tags as base.

  4. Add Ability.TargetLock to the Ability Tags.

  5. Set Toggle Activation, so the ability is activated and then deactivated on input.

Input Handler

Test Everything

  1. Hit Play and test the target lock by pressing the appropriate key.

  2. Capture the correct target via camera aiming, and also by proximity.

Last modified: 29 December 2024