How mklabs/ue4-targetsystemplugin works
Project type and purpose
• This is an Unreal Engine 5 plugin (TargetSystem) written in C++ that implements a Dark-Souls–style camera lock-on/targeting system.
• It ships with its own code module, configuration files, Blueprint-exposed hooks, and sample Content (Blueprints, Maps, UI, Meshes, Materials).
File structure
• Top-level:
• .github/workflows → CI pipelines for Windows/Linux and release automation
• LICENSE, readme.md
• TargetSystem/TargetSystem.uplugin → Unreal plugin descriptor
• TargetSystem/Config → DefaultInput.ini, FilterPlugin.ini (engine ini overrides)
• TargetSystem/Content → Example assets (Blueprints, Meshes, Animations, Maps, UI widgets)
• TargetSystem/Source/TargetSystem → C++ module
• Private → implementation (.cpp)
• Public → API headers (.h)
• TargetSystem.Build.cs → build configuration
Key insights from README
• Plugin registers an ActorComponent (TargetSystemComponent) you attach to your character.
• Exposes Blueprint-overrideable functions/events.
• Relies on engine systems: Pawn/Actor querying, Line-of-Sight traces, Input bindings, UMG widget for lock-on indicator.
a. Engine Host
– UE5 Core Systems: Input Subsystem, Actor/Component System, Rendering, Physics, UMG
– Plugin Manager (loads .uplugin descriptor & module)
b. TargetSystem Plugin Module (C++ code)
– Module Initialization (register component, register input actions)
– TargetSystemComponent
• Input handling (BindAxis/BindAction)
• Target acquisition logic (closest pawn, distance checks, LOS checks)
• Camera rotation control
• Exposed Blueprint hooks (OnLockedOn, OnLockedOff)
– Targetable Interface (IP) for custom actors
– Logging subsystem (TargetSystemLog)
c. Configuration
– INI files override default thresholds (min/max distances, input mappings)
d. Content Assets
– Example Blueprints (BP_TargetSystemTestGameMode, Character)
– Example Input Mapping Context (IMC_Default.uasset)
– UI Widget (WBP_LockOn)
– Meshes, Materials, Animations used in example
e. External Dependencies
– Unreal Engine subsystems listed above
Relationships and interactions
• Engine → Plugin Loader reads TargetSystem.uplugin → loads C++ module
• Module Startup → Registers TargetSystemComponent type with engine
• Game Author places TargetSystemComponent on Pawn
• Engine Input Subsystem → On user input → invokes component’s input callbacks
• Component logic → queries World for Pawns implementing TargetableInterface → applies LOS trace via Physics → selects target
• Blueprint event bindings → UI or game logic responds to lock/unlock
Architectural patterns and design principles
• Modular plugin architecture (Unreal’s module/plugin pattern)
• Component-based design (ActorComponent extension)
• Interface-driven targeting (Targetable Interface for extensibility)
• Data-driven configuration (INI overrides + Blueprint parameters)
• Separation of concerns: Input handling, targeting logic, camera control, UI rendering