Please note that Editor v1.30.8 has some breaking changes - please check release notes for details: Release v1.30.8 · playcanvas/editor · GitHub
One of the changes affects Tween library, so we updated it in the Asset Store - please update it.
Please note that Editor v1.30.8 has some breaking changes - please check release notes for details: Release v1.30.8 · playcanvas/editor · GitHub
One of the changes affects Tween library, so we updated it in the Asset Store - please update it.
Guys - we’re going to release the update to the Editor soon. Please make sure to get the latest Tween library, either now, or when you hit issues with it.
And this has been now released:
This might impact a small number of developers who may need to tweak their projects to be compatible.
Essentially, if you have modified the Application prototype in any way, you’ll need to update your code to modify AppBase instead. So, for example, if you do something like:
Application.prototype.myFunction = function () {
console.log(‘HI!’);
};
You will need to change this to:
AppBase.prototype.myFunction = function () {
console.log(‘HI!’);
};
It turns out that the Tween Library actually does this, so if your project uses this library, please head to either GitHub or the PlayCanvas Asset Store to update to the latest working version.
Please let us know on the forum if this change causes you any problems and we’ll be there to help!
Noticed an issue:
We have the following code in the project (don’t actually remember where it’s taken from). Now it breaks at line 8, saying that this.tween is undefined.
Worked well before the latest engine release.
pc.Entity.prototype.delayedCall = function (durationMS, f, scope) {
var n = 0;
while (this["delayedExecuteTween" + n]) {
n++;
}
var id = "delayedExecuteTween" + n;
var m;
this[id] = this.tween(m)
.to(1, durationMS / 1000, pc.Linear)
;
this[id].start();
this[id].once("complete", function () {
f.call(scope);
this[id] = null;
}, this);
return this[id];
};
@Igor - have you updated the tween to the new version, as mentioned above?
yep, the error started popping out after the update!
Let me check if the library is imported correctly, as there is no tween() method on Entity class at all:
Maybe you had some custom modifications done to tween, that was adding it to Entity prototype as well?
actually, looking at the tween script, it does it … strange it’s not added for you, as this bit has not changed at all
It seems the tween library script is being imported as asset, and thus never initialized (?)
I changed the loading type to ‘After engine’ and it started working (howerer other errors popped out )
How did you update the tween script … from the store, or manual drag & drop file?
Imported from the asset store
you may also check ‘preload’ checkbox on tween script
that worked, thanks!
Btw why don’t you turn on preload by default for assets that are imported from the store?
we do turn it on for some assets. Maybe we should do it for this one as well. In your case it’s ordering issue I suppose - tween script should be executed before everything depending on it.
If possible, please enable preload for tween.js by default.
It doesn’t contain any pc.ScriptType classes inside, so the only use case for it is to import/drop the script into some folder and forget about it…
I think most of the developers naturally expect it to be working out-of-the box immediately after being imported. And it’s a bit confusing that it doesn’t work until you manually turn the preload option on
I really hope that Tween can have a TypeScript version.
thanks for suggestion, it’s done already.