Search Issue Tracker

By Design

Votes

0

Found in

2021.3.31f1

2022.3.11f1

2023.1.17f1

2023.2.0b14

2023.3.0a11

Issue ID

UUM-54014

Regression

No

"error CS0019: Operator cannot be applied to operands of type" errors are thrown when using * and / operators with Vector2Int, Vector3Int, Vector3, and Vector4

-

How to reproduce:
Open the attached project "IN-57738.zip"

Expected results: No errors in the Console window
Actual results: "error CS0019: Operator cannot be applied to operands of type" errors are thrown

Reproducible with: 2021.3.31f1, 2022.3.11f1, 2023.1.17f1, 2023.2.0b14, 2023.3.0a11

Reproducible on: Windows 11 22H2
Not reproducible on: No other environment tested

  1. Resolution Note:

    those operators would bring ambiguity whether Dot product or Cross product is intended, thus operators support just scalar operation.
    Please take a look at Vector class documentation here for more details on how to use this class: https://docs.unity3d.com/2022.3/Documentation/Manual/VectorCookbook.html
    Also you can take a look on supported operators and static methods on the class here: https://docs.unity3d.com/ScriptReference/Vector3.html

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.