Tile - YLocalPlayer - Get Vertical Input – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Added link to Naru's corner (first link to youtube didn't work, but I realized can link it to the forum post))
m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}")
 
(6 intermediate revisions by 3 users not shown)
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 you press A
-->
** Returns +1 if you press D
== Get Vertical Input() ==
** Returns 0 if nothing or both are pressed
* Vertical input
** Returns -1 if you press S
** Returns +1 if you press 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 &quot;Player - Directional Movement&quot; within a **Custom Controls ** Game logic.




----
----
{{Ylands scripting navbox}}
{{Navbox/Ylands}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}


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

Latest revision as of 15:27, 24 November 2023

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.