godotjs / godotjs/javascript

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

Ouverte
#96 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
documentation investigation
Langage dominant
C++
Étoiles
1.1k
Forks
80
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.