Skip to main content

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.

OrderDefault keyWhat the champion does
MoveRight mouse button on the groundWalks to the point under the cursor, around obstacles. Held, the order repeats every 0.1 s, so the champion follows the cursor
AttackRight mouse button on an enemyWalks into attack range, stops and attacks until the enemy is dead. An enemy that walks away is followed
Attack-moveA, then left mouse buttonOn 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
StopSStops at once and forgets its order. An attack that is winding up is cancelled
HoldHStops 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 Blue or Red (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.

ModeWhat the key does
Quick CastThe press casts at the cursor. No indicator
Quick Cast with IndicatorHolding the key shows the indicator; releasing it casts. The move key cancels, at no cost
Normal CastThe 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).

KeyAction
Right mouse buttonMove, or attack the enemy under the cursor
A, then left mouse buttonAttack-move
S, HStop, hold
Q, W, E, RAbilities
D, FSummoner spells
Left Ctrl + an ability keyPut an ability point into that ability
1, 2, 3, 5, 6, 7Item slots
4, BWard, recall
PShop
Left mouse buttonConfirm an armed ability or attack-move
EscapeCancel what is armed; close the shop; open the match's settings
Y, Space, F7Camera lock, center on the champion, free camera
Tab, Enter, Alt + left clickScoreboard, chat, ping
F1, F2Start or vote yes on a surrender, vote no
F10The 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:

FunctionWhat 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):

FieldWhat it doesDefault
Quick Cast Target RadiusHow far from the cursor an ability cast on a unit looks for one150 cm
Unit Click RadiusHow far from the cursor a click still counts as on a unit60 cm
Attack Move Search RadiusHow far from an attack-move click an enemy is taken as its target300 cm
Move Repeat IntervalHow often a held move key repeats its order0.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 typeWhat is drawn
SkillshotA rectangle from the champion toward the cursor, Range long and Width wide, and the range as a ring
ChargedThe same rectangle, growing from Min Range to Range while the key is held, and the full range as a ring
AoE, ChannelA circle of the ability's Radius at the cursor, and the range as a ring. With Range 0 the circle is around the champion
ConeThe cone: Range long, Angle wide
Dash, BlinkA circle where the champion will land, and the range as a ring
TargetedThe 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):

FieldWhat it doesDefault
Line, Circle, Ring and Cone MaterialThe decal material per shapeM_Indicator_Line, _Circle, _Ring, _Cone
Valid Color, Invalid ColorWhile the cast would work, and would failblue, red
Show Range Ring While AimingAdds the ability's range as a ringon
Projection DepthHow far above and below a shape its decal reaches300 cm
Target ColorThe ring under the champion's targetred
Outline Material, Outline Enemy, Ally and Neutral Color, Outline ThicknessThe hover outlineM_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.

ModeHow to get thereWhat it does
UnlockedThe default; Y toggles itStays where it is. The cursor within 12 px of a screen edge pans it. Holding Space keeps it centered on the champion
LockedYStays on the champion
Free cameraF7, and F7 again to leaveFlies 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:

PropertyDefault
Camera Pitch-56°
Camera Yaw0°: the top of the screen is the world's +X
Camera Distance2200 cm from the point on the ground it looks at
Field Of View50°
Edge Pan Speed, Edge Pan Margin2400 cm/s, 12 px
Start Lockedoff
Free Camera Speed2400 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().