public sealed class ActionPlayerInputA player driven by named actions from a InputActionMap.
Remarks
The default, and what makes a working player controller two calls rather than an implementation. It expects a map holding a Move and a Look value action and any of the button actions it knows about; the names are properties, so a game whose asset calls them something else changes the names rather than the class.
⚠ This is the one place the engine gives up the property Vixen.Input is proudest of. A generated accessor turns a renamed action into a compiler error; a name looked up at run time turns it into an action that reads zero on the frame the player presses it. An engine cannot reference a game's generated class, so the default binds by name — and it resolves once, at construction, and throws naming the map and the action rather than failing quietly forever. A shipping game gets the compile-time property back by implementing IPlayerInputSource over its own accessor, which is a handful of lines.
Look is two devices wearing one action. A mouse produces a delta that is already independent of the frame rate; a stick produces a rate that has to be multiplied by it, and multiplying a mouse delta by the frame time makes the sensitivity depend on the frame rate — the bug every first-person game ships once. Which device won this frame is something the input system has already decided, so this asks ActiveBinding rather than guessing from the magnitude.
Fields and properties (4)
public InputActionMap MapThe map this reads.
public float PointerSensitivityRadians of turn per unit of a pointer's motion.
public float StickSensitivityRadians of turn per second at a stick's full deflection.
public bool InvertPitchWhether looking up moves the pitch down.
Methods (2)
public ActionPlayerInput(InputActionMap map, string moveAction = "Move", string lookAction = "Look")Creates a source over a map, resolving every action it needs at once.
public void Sample(ref ControlRotation rotation, ref MoveIntent intent, float deltaTime)Writes what the player is asking for this frame.
Used by (2)
- PlayerRigThirdPersonShooter
- PlayerInputTestsVixen.Engine.Tests