PlayerInput

Inherited: NativeBehaviour

Description

Note: A PlayerInput controller simplifies the management of the player control scheme. It can be used to get the current state of actions from the assigned ControlScheme.

Public Methods

float

axis (const std::string & name)

bool

button (const std::string & name)

ControlScheme *

controlScheme () const

void

setControlScheme (ControlScheme * scheme)

Static Methods

None

Methods Description

float PlayerInput::axis (std::string & name)

Returns the value of the virtual axis identified by name. The value will be in the range -1…1 for keyboard and joystick input devices.


bool PlayerInput::button (std::string & name)

Returns true in case of virtual button identified by name is pressed; otherwise returns false.


:ref:`ControlScheme<api_ControlScheme>`* PlayerInput::controlScheme () const

Returns the current assigned control scheme.

See also setControlScheme().


void PlayerInput::setControlScheme (ControlScheme * scheme)

Assigns a new control scheme. All previous bindings and key states will be cleaned.

See also controlScheme().