A Visual Script node used to call built-in functions.
- MATH_SIN = 0 — Return the sine of the input.
- MATH_COS = 1 — Return the cosine of the input.
- MATH_TAN = 2 — Return the tangent of the input.
- MATH_SINH = 3 — Return the hyperbolic sine of the input.
- MATH_COSH = 4 — Return the hyperbolic cosine of the input.
- MATH_TANH = 5 — Return the hyperbolic tangent of the input.
- MATH_ASIN = 6 — Return the arc sine of the input.
- MATH_ACOS = 7 — Return the arc cosine of the input.
- MATH_ATAN = 8 — Return the arc tangent of the input.
- MATH_ATAN2 = 9 — Return the arc tangent of the input, using the signs of both parameters to determine the exact angle.
- MATH_SQRT = 10 — Return the square root of the input.
- MATH_FMOD = 11 — Return the remainder of one input divided by the other, using floating-point numbers.
- MATH_FPOSMOD = 12 — Return the positive remainder of one input divided by the other, using floating-point numbers.
- MATH_FLOOR = 13 — Return the input rounded down.
- MATH_CEIL = 14 — Return the input rounded up.
- MATH_ROUND = 15 — Return the input rounded to the nearest integer.
- MATH_ABS = 16 — Return the absolute value of the input.
- MATH_SIGN = 17 — Return the sign of the input, turning it into 1, -1, or 0. Useful to determine if the input is positive or negative.
- MATH_POW = 18 — Return the input raised to a given power.
- MATH_LOG = 19 — Return the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use.
- MATH_EXP = 20 — Return the mathematical constant e raised to the specified power of the input. e has an approximate value of 2.71828.
- MATH_ISNAN = 21 — Return whether the input is NaN (Not a Number) or not. NaN is usually produced by dividing 0 by 0, though other ways exist.
- MATH_ISINF = 22 — Return whether the input is an infinite floating-point number or not. Infinity is usually produced by dividing a number by 0, though other ways exist.
- MATH_EASE = 23 — Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in.
- MATH_DECIMALS = 24 — Return the number of digit places after the decimal that the first non-zero digit occurs.
- MATH_STEPIFY = 25 — Return the input snapped to a given step.
- MATH_LERP = 26 — Return a number linearly interpolated between the first two inputs, based on the third input. Uses the formula
a + (a - b) * t.
- MATH_INVERSE_LERP = 27
- MATH_RANGE_LERP = 28
- MATH_DECTIME = 29 — Return the result of ‘value’ decreased by ‘step’ * ‘amount’.
- MATH_RANDOMIZE = 30 — Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
- MATH_RAND = 31 — Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use it with the remainder function.
- MATH_RANDF = 32 — Return a random floating-point value between 0 and 1. To obtain a random value between 0 to N, you can use it with multiplication.
- MATH_RANDOM = 33 — Return a random floating-point value between the two inputs.
- MATH_SEED = 34 — Set the seed for the random number generator.
- MATH_RANDSEED = 35 — Return a random value from the given seed, along with the new seed.
- MATH_DEG2RAD = 36 — Convert the input from degrees to radians.
- MATH_RAD2DEG = 37 — Convert the input from radians to degrees.
- MATH_LINEAR2DB = 38 — Convert the input from linear volume to decibel volume.
- MATH_DB2LINEAR = 39 — Convert the input from decibel volume to linear volume.
- MATH_POLAR2CARTESIAN = 40 — Converts a 2D point expressed in the polar coordinate system (a distance from the origin
rand an angle
th) to the cartesian coordinate system (x and y axis).
- MATH_CARTESIAN2POLAR = 41 — Converts a 2D point expressed in the cartesian coordinate system (x and y axis) to the polar coordinate system (a distance from the origin and an angle).
- MATH_WRAP = 42
- MATH_WRAPF = 43
- LOGIC_MAX = 44 — Return the greater of the two numbers, also known as their maximum.
- LOGIC_MIN = 45 — Return the lesser of the two numbers, also known as their minimum.
- LOGIC_CLAMP = 46 — Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to
min(max(input, range_low), range_high).
- LOGIC_NEAREST_PO2 = 47 — Return the nearest power of 2 to the input.
- OBJ_WEAKREF = 48 — Create a WeakRef from the input.
- FUNC_FUNCREF = 49 — Create a FuncRef from the input.
- TYPE_CONVERT = 50 — Convert between types.
- TYPE_OF = 51 — Return the type of the input as an integer. Check Variant.Type for the integers that might be returned.
- TYPE_EXISTS = 52 — Checks if a type is registered in the ClassDB.
- TEXT_CHAR = 53 — Return a character with the given ascii value.
- TEXT_STR = 54 — Convert the input to a string.
- TEXT_PRINT = 55 — Print the given string to the output window.
- TEXT_PRINTERR = 56 — Print the given string to the standard error output.
- TEXT_PRINTRAW = 57 — Print the given string to the standard output, without adding a newline.
- VAR_TO_STR = 58 — Serialize a Variant to a string.
- STR_TO_VAR = 59 — Deserialize a Variant from a string serialized using
- VAR_TO_BYTES = 60 — Serialize a Variant to a PoolByteArray.
- BYTES_TO_VAR = 61 — Deserialize a Variant from a PoolByteArray serialized using
- COLORN = 62 — Return the Color with the given name and alpha ranging from 0 to 1. Note: names are defined in color_names.inc.
- FUNC_MAX = 63 — The maximum value the function property can have.
A built-in function used inside a VisualScript. It is usually a math function or an utility function.
See also @GDScript, for the same functions in the GDScript language.