Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Missing typing definitions for Vector3 math #1298

Open
Luke0x22918 opened this issue Nov 2, 2022 · 2 comments
Open

[BUG]: Missing typing definitions for Vector3 math #1298

Luke0x22918 opened this issue Nov 2, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Luke0x22918
Copy link

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 Luke0x22918 added the bug Something isn't working label Nov 2, 2022
@Zepeto-TechEvangelist
Copy link
Collaborator

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.

@Luke0x22918
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants