HELP
Development FAQ

A red error line appears when using the Vector3 operator.

4min

When editing the ZEPETO script with VSCode editor, Vector3 operation is displayed as an error.

This error is only shown in the script editor, and there is no issue with the actual build and play.

To prevent red error lines from appearing in VSCode, you can use the following methods.



Change TypeScript version in VSCode

Change the TypeScript version to the Workspace version using the following guide.

📘 Please refer to the following guide. VSCode editor error



Using operator methods

Instead of Vector3 operations, use methods such as Vector3.op_Addition.

  • The following code is an example of adding two Vector3 values using Vector3.op_Addition.
Vector3 operator




  • The available Vector operators are as follows:

Method

Description

op_Addition($a: Vector3, $b: Vector3)

Add the values of two Vector3.

op_Subtraction($a: Vector3, $b: Vector3)

Subtract the second Vector3 from the first Vector3.

op_Multiply($a: Vector3, $d: number)

Multiply Vector3 by number.

op_Division($a: Vector3, $d: number)

Divide Vector3 by number.



👍 Tips Vector2 also has the same operator methods.