Controls and camera
A player commands a champion with the mouse: right-click to walk and attack, keys to cast. This page covers the orders, the cast modes and keys, the indicators drawn while aiming, and the camera. All of it is local to the player's own game except the orders and casts themselves, which the server checks.
Orders
A new order replaces the current one; there is no queue.
| Order | Default key | What the champion does |
|---|---|---|
| Move | Right mouse button on the ground | Walks to the point under the cursor, around obstacles. Held, the order repeats every 0.1 s, so the champion follows the cursor |
| Attack | Right mouse button on an enemy | Walks into attack range, stops and attacks until the enemy is dead. An enemy that walks away is followed |
| Attack-move | A, then left mouse button | On an enemy, or within 300 cm of one: attacks it. On empty ground: walks there and attacks the first enemy that comes into attack range on the way, then walks on |
| Stop | S | Stops at once and forgets its order. An attack that is winding up is cancelled |
| Hold | H | Stops and stays. Enemies that come into attack range are attacked; none is chased |
- Attack range is measured from the edge of the champion's body to the edge of its target's.
- A click on ground that cannot be walked on leads to the nearest walkable point, searched for within 10 m.
- A right-click on an ally walks to where the ally stands and stops there.
- A champion that makes no headway for half a second gives up its Move order, so it does not push against a wall forever. Standing still during a cast time does not count.
- A cast out of range is an order too: the champion walks into the ability's range and then casts.
- A move, attack or cast order ends a channel. A stun does not clear the order: the champion carries on when it can.
- A right-click on the minimap walks the champion to that point; see HUD and theme.
Over the network
The player's own game finds the path and moves the champion at once; the engine's character movement predicts it, and the server replays every move with the champion's real speed and collision. A correction smaller than 50 cm is blended in over 0.15 s, a larger one snaps. The owning game also decides when to attack and asks for each attack, which the server checks like a cast: the target must be a living enemy within range, and the time since the last attack must have passed. See Multiplayer.
What your map needs
- A nav mesh. Place a Nav Mesh Bounds Volume over the walkable area and build paths.
- Player starts tagged
BlueorRed(the Player Start Tag). A joining player goes to the smaller team and spawns at a free start of that team; a champion that respawns comes back at one of them.
From code
AMobaChampion::GetOrders() returns the champion's UMobaOrderComponent: OrderMove(Point), OrderAttack(Unit),
OrderAttackMove(Point, SearchRadius), OrderStop(), OrderHold(), OrderCast(Slot, Aim, Range), and to read it
GetOrder(), GetMoveGoal(), GetTarget() and the delegate OnOrderChanged. Give orders on the machine that
controls the champion: the owning client for a player, the server for a bot.
MobaTargeting (a namespace in the Core module) finds and judges units the same way for orders, abilities and bots:
IsLivingEnemy, GetEdgeDistance, FindUnitsInRadius, FindNearestEnemy.
Cast modes
Each ability key has a cast mode, which decides when the key casts. The player chooses it per key in Settings; a key without a choice uses the Default Cast Mode of the ability on it.
| Mode | What the key does |
|---|---|
| Quick Cast | The press casts at the cursor. No indicator |
| Quick Cast with Indicator | Holding the key shows the indicator; releasing it casts. The move key cancels, at no cost |
| Normal Cast | The press arms the indicator. The confirm click (left mouse button) casts. The move key or Escape cancels |
- A charged ability starts to charge on the press and casts on the release, in every mode.
- A toggle that is on is switched off by its key.
- An ability cast on a unit takes the unit under the cursor, or else the nearest unit it can affect within the Quick Cast Target Radius of the cursor. With no such unit the key does nothing.
- A second ability key pressed while aiming replaces the first one's aim, at no cost.
- While the cast would fail (cooldown, mana, silence) the indicator is red, and releasing or confirming casts nothing.
Cast modes are input only: the server gets the same cast request whichever mode made it. UMobaPlayerSettings keeps
each player's choice per slot (Q, W, E, R, D, F), so it survives a rebind of the key, and saves it in
GameUserSettings.ini on the player's PC: UMobaPlayerSettings::Get() (Blueprint: Get MOBA Player Settings),
SetCastMode(Slot, Mode), ClearCastMode(Slot), GetCastMode(Slot, Definition) and SetCancelOnRightClick(bool).
Keys
Every action is an Input Action in the mapping context IMC_PioneerMoba_KBM (plugin content, Input folder).
| Key | Action |
|---|---|
| Right mouse button | Move, or attack the enemy under the cursor |
| A, then left mouse button | Attack-move |
| S, H | Stop, hold |
| Q, W, E, R | Abilities |
| D, F | Summoner spells |
| Left Ctrl + an ability key | Put an ability point into that ability |
| 1, 2, 3, 5, 6, 7 | Item slots |
| 4, B | Ward, recall |
| P | Shop |
| Left mouse button | Confirm an armed ability or attack-move |
| Escape | Cancel what is armed; close the shop; open the match's settings |
| Y, Space, F7 | Camera lock, center on the champion, free camera |
| Tab, Enter, Alt + left click | Scoreboard, chat, ping |
| F1, F2 | Start or vote yes on a surrender, vote no |
| F10 | The match's settings. In Play In Editor, Escape ends the session before the game sees it |
The player's own keys
Every action is player mappable through Enhanced Input's user settings, which the plugin switches on and which save
the keys on the player's PC. The framework ships no key-binding screen; build yours on these functions of
AMobaPlayerController, or on Enhanced Input's own API:
| Function | What it does |
|---|---|
GetBoundKey(MappingName) | The key an action has now |
RebindKey(MappingName, NewKey, OutActionsThatLostTheKey) | Binds the action to the key and saves. An action that had the key loses it; the list names it, so the screen can tell the player |
ResetKeyBindings() | Gives every action its default key, and saves |
An action's mapping name is Moba. and its asset's name without IA_: Moba.Ability_Q, Moba.Move,
Moba.AttackMove, Moba.Stop, Moba.RankUpModifier. To change a default, edit the mapping context; to add an action
of your own, give its mapping Player Mappable Key Settings with a name, and it can be rebound like the rest.
The Input Config
DA_PioneerMoba_Input (plugin content, Input folder):
| Field | What it does | Default |
|---|---|---|
| Quick Cast Target Radius | How far from the cursor an ability cast on a unit looks for one | 150 cm |
| Unit Click Radius | How far from the cursor a click still counts as on a unit | 60 cm |
| Attack Move Search Radius | How far from an attack-move click an enemy is taken as its target | 300 cm |
| Move Repeat Interval | How often a held move key repeats its order | 0.1 s |
From code
UMobaCastingSubsystem is the local player's casting: PressAbility(Slot), ReleaseAbility(Slot), ConfirmAim()
and CancelAim() do what the keys do, so on-screen buttons can call them. CastAt(Slot, Point) and
CastOn(Slot, Unit) cast at once whatever the mode. ShowAbilityRange(Slot, bShow) draws an ability's range as a
ring, for a HUD button the pointer hovers.
Indicators
While a player aims an ability, its real size is drawn on the ground, built from the Ability Definition's own Range, Width, Radius and Angle, so what the player sees is what the ability hits.
| Cast type | What is drawn |
|---|---|
| Skillshot | A rectangle from the champion toward the cursor, Range long and Width wide, and the range as a ring |
| Charged | The same rectangle, growing from Min Range to Range while the key is held, and the full range as a ring |
| AoE, Channel | A circle of the ability's Radius at the cursor, and the range as a ring. With Range 0 the circle is around the champion |
| Cone | The cone: Range long, Angle wide |
| Dash, Blink | A circle where the champion will land, and the range as a ring |
| Targeted | The range as a ring |
- The indicator turns red when the cast would fail. An area aimed beyond its range is drawn red too: the cast walks the champion into range first.
- The attack range shows as a ring while the attack-move key is held. Attack range is measured between the edges of the bodies, so an enemy whose body touches the ring is in range.
- Indicators are local: no other player sees where someone aims. They are decals, so they follow uneven ground.
What the cursor is on
- The unit under the cursor is outlined: red for an enemy, blue for an ally, yellow for a neutral monster, structures included. It is exactly the unit a right-click there attacks or walks to. A unit hidden from the player or dead is never under the cursor, and the player's own champion is never outlined.
- The unit the champion attacks or chases has a ring at its feet until the order ends or the unit dies or goes out of sight.
- Over an enemy a right-click would attack, the cursor becomes the theme's attack cursor.
The outline is a post-process pass the player's camera adds to the view, using the custom depth stencil. The framework
turns the stencil on at startup (r.CustomDepth 3) when the project has it lower, so a map needs no post-process
volume. A unit's meshes that use custom depth for something else lose it while hovered.
How they look
The Indicator Style DA_IndicatorStyle_Default (plugin content, Indicators folder):
| Field | What it does | Default |
|---|---|---|
| Line, Circle, Ring and Cone Material | The decal material per shape | M_Indicator_Line, _Circle, _Ring, _Cone |
| Valid Color, Invalid Color | While the cast would work, and would fail | blue, red |
| Show Range Ring While Aiming | Adds the ability's range as a ring | on |
| Projection Depth | How far above and below a shape its decal reaches | 300 cm |
| Target Color | The ring under the champion's target | red |
| Outline Material, Outline Enemy, Ally and Neutral Color, Outline Thickness | The hover outline | M_PioneerMoba_UnitOutline, red, blue, yellow, 3 px |
To use your own look, duplicate the style, set your materials and colors, and assign it to the Indicators
component of your player controller Blueprint. An indicator material of your own uses the Deferred Decal domain and
Translucent blend mode, with a vector parameter Color for the valid or invalid color and a vector parameter Size:
R is the shape's length in cm, G its width in cm, B a cone's full angle in degrees. U runs along the shape from the
champion outward, V across it.
Camera
A top-down camera for the local player. It never replicates: the server knows nothing of where a player looks.
| Mode | How to get there | What it does |
|---|---|---|
| Unlocked | The default; Y toggles it | Stays where it is. The cursor within 12 px of a screen edge pans it. Holding Space keeps it centered on the champion |
| Locked | Y | Stays on the champion |
| Free camera | F7, and F7 again to leave | Flies over the map with the arrow keys; hold the middle mouse button and move the mouse to look around |
- Edge pan and the free camera stop at the map's border, and edge pan stops while the game window has no focus.
- Whenever the player gets a champion (at the start of a match, at each respawn) the camera centers on it once.
- A left click on the minimap moves the camera there.
Where the numbers are
On the player controller's Moba Camera component (MobaCameraComponent), editable in a Blueprint of
MobaPlayerController:
| Property | Default |
|---|---|
| Camera Pitch | -56° |
| Camera Yaw | 0°: the top of the screen is the world's +X |
| Camera Distance | 2200 cm from the point on the ground it looks at |
| Field Of View | 50° |
| Edge Pan Speed, Edge Pan Margin | 2400 cm/s, 12 px |
| Start Locked | off |
| Free Camera Speed | 2400 cm/s |
Each player's own choices are in UMobaCameraSettings, saved in GameUserSettings.ini and shown in Settings: edge pan
on or off, edge pan speed from 25% to 200%, and whether a match starts locked. The camera reads them every frame, so a
change applies in the middle of a match.
What your map needs
Place one Moba Map Bounds actor and scale its box over the playable area. That box is the camera's border.
From code
AMobaPlayerController::GetMobaCamera() returns the component: ToggleLock(), SetCentering(bool),
ToggleFreeCamera(), SetFocus(Point), GetFocus(), GetMode().