zepeto-studio-kor icon indicating copy to clipboard operation
zepeto-studio-kor copied to clipboard

[BUG]: Missing typing definitions for Vector3 math

Open Luke0x22918 opened this issue 2 years ago • 2 comments

Please tell us the version of the ZEPETO World package. (You can check the version in Unity > Window > Package Manager.) ZEPETO.World = 1.7.0 ZEPETO.Script.UnityEngine.Typings = 1.0.5

Please tell us which version of the ZEPETO app is currently installed. (You can check the version in ZEPETO App > MY > Settings > Version.) N.A.

What features were you trying to implement? I want to manipulate Vector3 values.

What problem did you encounter? When using Vector3 math such as vector3_0 + vector3_1, the editor says this is an invalid operation. However when I put //@ts-ignore above such statement, the code works as intended.

Please tell us your development environment. Platform: Windows 11 Editor: Visual Studio Code

Screenshots displaying the issue:

image image

Luke0x22918 avatar Nov 02 '22 15:11 Luke0x22918

Hello, Based on what you told us, we did a test. If I write the same code in rider, no error occurs. Also, if you explicitly enter it in TypeScript, as in the example below, no error will occur. Untitled

If there is no //@ts-ignore, it would be nice to additionally check that play and calculation do not work due to the warning.

Zepeto-TechEvangelist avatar Nov 22 '22 08:11 Zepeto-TechEvangelist

Hello, thank you for your reply. I recently learned that TypeScript does not support Operator overloading. So I don't know if there is a type definition that can be done to let the editor know that it's possible to apply math operations to two vector3 values.

The code below demonstrates that the operation works as expected. Without the //@ts-ignore my editor gives the following error: Operator '+' cannot be applied to types 'import("UnityEngine").Vector3' and 'import("UnityEngine").Vector3'. image

Luke0x22918 avatar Nov 22 '22 11:11 Luke0x22918