Input Manager

Presented via IInputManager interface, this small but useful system provides you with information about player inputs.

Currently this system is supporting WASD inputs, but in future functonality of Input Manager will be extended.

To use this system, inject IInputManager interface into your class, as shown below:

[Inject] private IInputManager inputManager;

Available methods

Vector3 GetMovementDirection()

This method returns normalized movement direction (in screen space). For example, if player is pushing W button on keyboard, this method returns (0, 0, 1).

Example:

Vector3 movementDir = inputManager.GetMovementDirection();

characterController.Move(moveSpeed * Time.deltaTime * cameraController.GetWorldDirection(movementDir));

As you can see in example, you can convert screen space movement direction into world space direction via GetWorldDirection method of CameraController class.

Last updated