IsInputAttached

From Spheriki

Jump to: navigation, search

Returns true if input is attached to a person.


Contents

Usage

boolean IsInputAttached();
  • boolean is returned. true if input is attached, false otherwise.


Examples

A simple script to temporarily remove input control.

if (IsInputAttached()) {
  var person = GetInputPerson();
  DetachInput();
  
  // Do cutscene stuff here...
  
  AttachInput(person);
}

The script uses IsInputAttached() to see if the player can move. If they can, the input person is saved, and the input detached. Any cutscene code goes in after this. After that, control is restored using AttachInput(), applied to the same person from which it was removed.


Notes

  • When this returns true, the player is able to move around using their configured keys. This control is only offered automatically while the map engine is running.


See also

Personal tools