Lock On
Keeps the character facing a target and circling it. Fighting one enemy among many stays manageable.
Locks the character onto a target: the body faces it, and moving circles around it. Fighting one enemy among many becomes manageable.
How it works
Changes the Walking mode: locked on: faces the target, slower sideways and back. Changes Dodge: locked on: rolls around the target, facing it.
Lock-On: press Lock On to pick the target nearest the middle of the view (within reach and in sight), as in melee action role-playing games. While locked, the view turns to the target, so the stick moves relative to it: sideways circles it, back retreats from it. The body keeps facing the target, and moving sideways or back is slower. While sprinting the body turns toward the run instead, and faces the target again after. A dodge rolls any way around the target, still facing it. The camera keeps the target in frame (see CameraTarget.focus).
Looking while locked: with Switch Targets (as in the games) a flick of the mouse or the right stick moves the lock to the next target that way, and the view stays on the target; with Free Look the view goes where you look and turns back to the target after recenterDelay.
Press again to let go; the lock also breaks beyond breakRange or when the target has been out of sight for lostSightTime. With no target in reach, a press turns the view to where the body faces.
Combine it
- Used by the presets: Action RPG.
Properties
| Property | Description | Range | Default |
|---|---|---|---|
| Character | The character this module belongs to. Drag its Character Motor here. | None | |
| Acquire Range | Farthest target a press can pick, metres. | 0 or more | 20 |
| Acquire Angle | Widest angle from the view's direction at which a press can pick a target, degrees. | 0 to 180 | 60 |
| Break Range | The lock breaks when the target is farther than this, metres. | 0 or more | 25 |
| Lost Sight Time | The lock breaks after the target has been out of sight this long, seconds. | 0 or more | 1 |
| Sight Mask | Layers that block the sight of a target. | Default, TransparentFX, 3, Water, UI, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 | |
| Look | Switch Targets: a flick moves the lock to the next target. Free Look: look freely, the view returns later. | Switch Targets | |
| Switch Flick | Switch Targets: a flick at least this big switches, degrees of view turn. | 0.1 or more | 8 |
| In Line Angle | Switch Targets: targets within this angle of the smallest turn count as in line; the nearest wins, degrees. | 0 to 45 | 8 |
| Switch Cooldown | Switch Targets: seconds after a switch before the next flick counts. | 0 or more | 0.3 |
| Recenter Delay | Free Look: seconds without looking before the view turns back to the target. | 0 or more | 0.8 |
| Sideways Scale | Speed scale moving straight sideways, compared with forward. | 0 to 1 | 0.65 |
| Back Scale | Speed scale moving straight back, compared with forward. | 0 to 1 | 0.5 |
| View Turn Rate | How fast the view turns to the target, degrees per second. | 0 or more | 540 |
| Pitch Offset | The view looks this much further down than straight at the target, degrees. | 15 | |
| Pitch Distance | The view's tilt is worked out as if the target were at least this far, so a near one does not tip it, metres. | 0.1 or more | 4 |
| Max Pitch | The lock tilts the view at most this far up or down, degrees. | 0 to 80 | 25 |