vector1
title: vector1 toc_hide: true aliases:
- /docs/scripting-reference/runtimes/lua/functions/vec1/
Creates a new vector1 value.
Unlike other vector types, vector1 simply returns a plain number.
This means that vector1(x) == x is always true and type(vector1(x)) returns number.
It has no practical use and exists solely for completeness within the vector type system.
More about vectors in the Lua runtime manual.
Syntax
number vector1(float x)
number vec1(float x)
Required arguments
- x: A floating point number representing the
xvalue of your vector.
Examples
Basic vector1 functionality:
-- vector1 returns a plain number:
print(type(vector1(1))) -- prints `number`
-- It is equivalent to the input value:
print(vector1(1) == 1) -- prints `true`
-- Using the alias:
print(vec1(1) == 1) -- prints `true`
title: vector1 toc_hide: true aliases:
- /docs/scripting-reference/runtimes/lua/functions/vec1/
Creates a new vector1 value.
Unlike other vector types, vector1 simply returns a plain number.
This means that vector1(x) == x is always true and type(vector1(x)) returns number.
It has no practical use and exists solely for completeness within the vector type system.
More about vectors in the Lua runtime manual.
Syntax
number vector1(float x)
number vec1(float x)