
TargetLockOn
Lock-on reticle for controller gameplay, with camera adjustment based on your equipped weapon and a trajectory preview for ranged aiming.TargetLockOn
ARPG lock-on system for Valheim, built for controller. The camera adapts to the weapon you're holding, and ranged shots get ballistic aim and a trajectory preview.
What it does
R3 to lock, flick the right stick to switch target. On keyboard: 0 to lock, and a quick mouse swipe to switch.
With melee weapons you keep vertical aim. With bows, crossbows, staffs, bombs and spears the camera locks vertically too, and your shots are aimed to land on the target, drop included.
Features
- Ballistic aim: locked shots go where the camera points and account for projectile speed, gravity, air drag and how far you've drawn the bow. No homing: a target that dodges can still be missed. Locked bombs land 30 m out at most. Weapon spread still applies.
- Trajectory preview always with bombs, and in free aim while drawing a bow or holding a loaded crossbow.
- Lock points on big creatures: trolls, the Gammeltroll, the Elder, Moder, Fader and their Aspects, the Abomination, the Gjall and Seekers. Weak spots are the game's own (troll head, Gjall belly, Seeker Soldier tail) and take weak spot damage.
- Light and weather: darkness and fog shorten how far you can lock, and a torch or campfire lights a target back up. A target hidden for 3 seconds (behind cover, in fog, or in Mistlands mist past 30 m) drops the lock. Bosses and big creatures are half as affected.
- Contextual HUD: creature health bars hide behind cover and in fog, fade right after your crosshair leaves, and stay on your target.
- The game's own crosshair jumps onto your target while locked, bow draw circle and stealth indicators included.
- R3 with nothing to lock turns your character toward the camera.
- Client side. Works on vanilla servers and with friends who don't have it.
Configuration
The config file is created after the first launch: BepInEx/config/vktr.targetlockon.cfg
| Section | Setting | Default | What it does |
|---|---|---|---|
| Input | GamepadLockButton |
JoyRStick | Gamepad button that locks and releases (game button name). Ignored while L3 is also held |
| Input | LockKey |
0 (Alpha0) | Keyboard or mouse key that locks and releases |
| Input | PrevTargetKey / NextTargetKey |
none | Keys that switch to the next target on the left / right |
| Input | MouseFlickPixels |
60 | Mouse move (pixels) that switches target while locked. 0 turns it off |
| Input | FaceCameraWithoutTarget |
true | With nothing to lock, the lock button turns your character toward the camera |
| Lock | LockRange |
50 | Max lock distance (m) in full light and clear weather |
| Lock | DarkRangeFactor |
0.4 | Share of LockRange for a creature in full darkness. 1 turns it off |
| Lock | WeatherHidesTargets |
true | Fog and Mistlands mist hide creatures, both for locking and for keeping the lock |
| Lock | MistRange |
30 | In Mistlands mist, creatures farther than this (m) count as hidden |
| Lock | LargeCreatures |
trolls, Gjall, Valkyrie, Abomination, Aspects | Creatures that light and weather affect less. Bosses count without being listed |
| Lock | LargeEnvironmentWeight |
0.5 | How much light and weather count for those creatures. 0.5 = half |
| Lock | LockAngle |
37 | How far from the screen center (degrees) a target can be when you lock |
| Lock | SwitchAngle |
53 | How far from the screen center (degrees) the next target can be when you switch |
| Lock | LostSightSeconds |
3 | Seconds a target can stay hidden before the lock is lost |
| Lock | RelockOnKill |
true | When your target dies, lock onto the next one in view |
| Lock | IgnoreTargets |
empty | Prefab names that can never be locked, comma separated |
| Lock | MultiNodeTargets |
true | Lock points on the creatures listed in TargetNodes |
| Lock | TargetNodes |
see below | Lock points per creature |
| Camera | PitchLock |
RangedAndSpears | Which weapons lock the vertical camera too: Off, RangedAndSpears, AllWeapons |
| Camera | CameraSpeed |
12 | How fast the camera turns to the target |
| Camera | StrafeWhileLocked |
true | Face the target while walking locked |
| Camera | AttackTowardsTarget |
true | Attacks turn you to the target and melee swings aim at it |
| Aim | BallisticAim |
true | Aim locked shots for projectile drop |
| Aim | AimAt |
Camera | Camera: shots go where the camera points. Target: shots go to the target's exact position (almost never miss) |
| Aim | LeadMovingTargets |
false | Aim ahead of a moving target, where it will be when the shot lands |
| Aim | BombLockRange |
30 | Farthest point (m) a locked bomb is aimed at. Free aim has no limit |
| Trajectory | TrajectoryLine |
true | Show the flight path: bombs always, bows and crossbows in free aim |
| Trajectory | ImpactMarker |
true | Show a ring where the path hits |
| Trajectory | TrajectoryColor / TrajectoryWidth |
white / 0.04 | Look of the line |
| HUD | HideHudBehindObstacles |
true | Hide creature health bars behind obstacles and in fog or mist. Boss bars stay |
| HUD | HoverHudSeconds |
0.3 | How long a health bar stays after your crosshair leaves the creature (vanilla: 60) |
| HUD | LockMarkerStyle |
Crosshair | Crosshair: the game's crosshair moves onto your target. Ring: a small ring instead. Off: nothing |
| HUD | LockMarkerSize / LockMarkerColor |
16 / white | Ring style only: size and color of the ring |
| Debug | DebugLog |
false | Write lock changes and the numbers of every aimed shot to the BepInEx log |
| Debug | DumpCreatureRigs |
false | On world load, write every creature's skeleton and weak spots to BepInEx/TargetLockOn_rigs.txt |
TargetNodes is written as Prefab=Point,Point;Prefab=Point,Point. A point is a body part (Head, Chest, LeftLowerLeg, RightLowerArm...), a bone name, or WeakSpots. Points are switched in the order you write them. Unlisted creatures get one point in their center. For creatures from other mods, turn on DumpCreatureRigs, load a world once and read their bone names from the file.
Notes
R3 keeps its usual job in your gamepad layout. If that gets in the way, move the lock with GamepadLockButton. L3 + R3 never locks, so the guardian power combo still works.
Technical details
- The camera follows the player's look direction, so the mod turns it toward the target right after the game reads your input, and keeps the locked axes out of it.
- Shots are rebuilt the way the game fires them (ammo speed, draw curve, launch angle) and simulated with the game's own projectile step to find the angle that hits.
- Light on a creature is the value the game uses for your own stealth. Fog is the game's live fog, which changes with weather and time of day.
- Health bars are the game's own: the mod only drives their hover timer.
- Lock points come from the creature's skeleton: body parts by humanoid role where the rig has one, by bone name otherwise. Weak spots come from the game's weak spot list.
Installation
With r2modman / Thunderstore Mod Manager: click install, done.
Manually: install BepInExPack Valheim, then drop TargetLockOn.dll into BepInEx/plugins.