Tile - YLocalPlayer - Get Vertical Input – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Image:Ylands_Tile_-_Character_input.png]]
<!---
* Horizontal input
THIS PAGE WAS GENERATED AUTOMATICALLY; DO NOT EDIT IT, OTHERWISE YOUR CHANGES WILL BE LOST DURING FUTURE UPDATE.
** Returns -1 if the player presses A
-->
** Returns +1 if the player presses D
== Get Vertical Input() ==
** Returns 0 if nothing or both are pressed
* Vertical input
** Returns -1 if the player presses S
** Returns +1 if the player presses W
** Returns 0 if nothing or both are pressed
=Examples=
Simple example (no turning):
[[Image:Ylands Tile - Character input-Example1.png]]


[[File:YlandsTile-939.png]]


Complex example from [https://ylands.com/community/topic/29065-narus-corner-10-controlling-a-plane-with-custom-inputs/ Naru's Corner #10]:
<pre>static getPrimaryVerticalInput(): number;</pre>
[[Image:Ylands Tile - Character input-Example2.png]]
=== Returns ===


=Notes=
'''number'''
* Only available in single player
 
=== Description ===
 
Vertical input of the '''player''' in a single player game.
 
=== Notes ===
 
* Returns -1 if the player presses S
* Returns +1 if the player presses W
* Returns 0 if nothing or both are pressed
* On a phone, or with a game controller, partial numbers between -1 and 1 are possible.
* On a phone, or with a game controller, partial numbers between -1 and 1 are possible.
* This tile does not automatically prevent player movement. This can be disabled separately by unchecking "Player - Directional Movement" within a [[Ylands_Game_logic_-_Custom_controls|Custom Controls]] game logic or using this tile:
* This tile does not automatically prevent player movement. This can be disabled separately by unchecking &quot;Player - Directional Movement&quot; within a **Custom Controls ** Game logic.
[[Image: Ylands_Tile_Default_Key_Action_-_Player_Directional_Movement_False.png]]
 


----
----
Line 27: Line 29:


[[Category: Instructions]]
[[Category: Instructions]]
[[Category: Ylands 1.5]]

Revision as of 09:52, 8 July 2021

Get Vertical Input()

YlandsTile-939.png

static getPrimaryVerticalInput(): number;

Returns

number

Description

Vertical input of the player in a single player game.

Notes

  • Returns -1 if the player presses S
  • Returns +1 if the player presses W
  • Returns 0 if nothing or both are pressed
  • On a phone, or with a game controller, partial numbers between -1 and 1 are possible.
  • This tile does not automatically prevent player movement. This can be disabled separately by unchecking "Player - Directional Movement" within a **Custom Controls ** Game logic.