Hello,
I would like to store the tween in my variable but I don’t know what it is the type exactly.
Thanks.
Hello,
I would like to store the tween in my variable but I don’t know what it is the type exactly.
Thanks.
Which version are you using?
The issue is just that you have not imported the Tween.
import { Tween} from ‘cc’;
If you are on VS code you can just click on the Tween with red line and VS code will suggest a quick fix.
Thanks for your replies.
I’m using CocosCreator 3.6.2 and I already tried to import the Tween class.
What should be the correct declaration?
Tween:
Le type générique 'Tween<T>' exige 1 argument(s) de type.ts(2314)
Tween<Node>
:
Impossible d'assigner le type 'import("cc").Tween<import("cc").Node>' au type 'import("cc").Tween<Node>'.
Les types de la propriété 'then' sont incompatibles.
Impossible d'assigner le type '(other: import("cc").Tween<import("cc").Node>) => import("cc").Tween<import("cc").Node>' au type '(other: import("cc").Tween<Node>) => import("cc").Tween<Node>'.
Les types des paramètres 'other' et 'other' sont incompatibles.
Impossible d'assigner le type 'import("cc").Tween<Node>' au type 'import("cc").Tween<import("cc").Node>'.
Les types de la propriété 'target' sont incompatibles.
Impossible d'assigner le type '(target: Node) => import("cc").Tween<Node>' au type '(target: import("cc").Node) => import("cc").Tween<import("cc").Node>'.
Les types des paramètres 'target' et 'target' sont incompatibles.
OK I think I fixed my problem by adding Tween
AND Node
in the import lists.