When do I use () after a function?

MAXScript Frequently Asked Questions

A MAXScript function is stored in a variable. Some functions can take no arguments, others can expect one or more arguments (parameters).

If you type in only the name of the function, you are not actually calling the function but asking MAXScript to print the variable the function is stored in.

For example

-- type in the constructor of a Box without ()

box

Box

-- MAXScript tells you the variable box contains the function Box

In order to call a function without any arguments, you have to tell the function that no parameters are going to be passed to it. To do this, you add the pair of parentheses to the end of the function name.

For example

-- type in the constructor of a Box with ()

box()

$Box:Box01 @ [0.000000,0.000000,0.000000]

-- MAXScript executes the Box constructor function without parameters

See also

Function Calls

Special Notes About Function Calls

Frequently Asked Questions