[SOLVED] Tween Manager Error

You need to delete your currunt tween thingy and download a new one from the asset store.

2 Likes

where is this asset store?

You can find the Asset Store button in the editor, on the bottom right of your scene.

Indeed! Found it! Thanks!

2 Likes

I’ve been having this error [in local development] for the past month, have been ignoring it but trying now to get rid of it.

I’ve deleted the “tween animation library” folder from the folder hierarchy, then re-downloaded it from the Asset Store, but the error persists.

Any tips? :slight_smile: @Albertos

Hi @Michaelsking1993 and welcome!

Can you please show your error?

1 Like

I’m not sure what could be the problem.

Maybe you can try to import it from the page below.

How do I phyically import it from github? What does that mean? :thinking: (sorry if that is a dumb question, it’s just not apparent to me at first or second thought :slight_smile: )

Hi @Michaelsking1993,

You can download the tween.js script from the repo and upload it to your PlayCanvas project.

Or you can import the tween library using from the PlayCanvas Asset Store, there is button to the top right of your assets panel.

1 Like

I find that after an update with new tweener.js the .start() function must be placed before the .on(‘complete’…‘update’… and other events.
Code like this:

this.entity
.tween(…)
.to(…)
.on(‘complete’,function(){…})
.start();

  • will make error

this.entity
.tween(…)
.to(…)
.start()
.on(‘complete’,function(){…});

  • will work properly

The github overview (GitHub - playcanvas/playcanvas-tween: A tween library for PlayCanvas) now includes events like onComplete, onUpdate rather than .on(‘complete’,…) . I have tested them and there is no error when onComplete is before .start() in this kind of animation call.

Hi @Andrew_S and welcome!

Probably it looks like this work properly, because you exclude .on() (which is not working anymore) from the tween. Instead you need to update the code and use .onComplete().

1 Like

I think on() is now deprecated, but it still works. I tested it. In the placanvas animation examples (Using the Tween library | Learn PlayCanvas) it is still used.
(project - PlayCanvas | HTML5 Game Engine,
code - PlayCanvas | HTML5 Game Engine

  this.tween.on('update', function () {
      this.entity.model.material.diffuse = this.tweenedProperties.diffuse;
      this.entity.model.material.update();
  }.bind(this));

)

I think this page still need to be updated, but if it works for you you’re in luck! :four_leaf_clover:

But updaitng the code is a good idea :slight_smile:

I created an issue to get this manual page updated:

1 Like

Why in hell did you change this? Now every single projects with Tween is going to be a pain to change and for what?
Why???
SO unneccesary

which playcanvas version is the last before this big change please?

The last version, before the engine has introduced an improved events handling system was 1.65.5. I don’t like breaking changes as well, but I also don’t like using an underperforming system simply because an improved one will break it.

You can also use the original Tween library directly as well. Although, it has the same syntax as the current PlayCanvas version:

1 Like

Well, I tried using the old tween library but it gives the breaking bugs the original post was about. I can’t go trhough the pain of updating every single tween function in an old project who needs updating so I’ll use the 1.65 engine version.
thank you for sharing this info