WXYZ Component/Coordinate (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.2-dev28, 2.10 (quaternions)

Syntax

[the] (x|y|z|w)( |-)[component[s]|coord[inate][s]|(pos[ition[s]]|loc[ation][s])] of %objects%

Description

Gets or changes the W, X, Y or Z component of anything with these components/coordinates, like locations, vectors, or quaternions. The W axis is only used for quaternions, currently.

Examples

set {_v} to vector(1, 2, 3)
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"
set {_x} to x of player
set {_z} to z of player
if:
	{_x} is between 0 and 100
	{_z} is between 0 and 100
then:
	set y component of player's velocity to 10

View source