godotjs / godotjs/javascript

Typescript complains when trying to use operators such as += on Vector2

Offen
#96 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
documentation investigation
Vorherrschende Sprache
C++
Sterne
1.1k
Forks
80
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

e.g. Something like this:

```typescript
this.position += new godot.Vector2(this.velocity * delta)
```

Will generate the following error in typescript:

```error
Operator '+=' cannot be applied to types 'godot.Vector2' and this.position + 'godot.
—————————————————
The left-hand side of an arithmetic operation must be of type godot.register_property 'any', 'number', 'bigint' or an enum type.
```

Is this an error on my part of a problem wit the type declaration?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.