Tweens issue

I was checking a Rugby Game we did a while ago and it doesn’t work because of a script which manages tweens.

tween.js

These last lines of the script are causing problems:

// Add pc.Entity#tween method
    pc.Entity.prototype.tween = function (target, options) {
        var tween = this._app.tween(target);
        tween.entity = this;

        this.once('destroy', tween.stop, tween);

        if (options && options.element) {
            // specifiy a element property to be updated
            tween.element = options.element;
        }
        return tween;
    };

    // Create a default tween manager on the application
    var application = pc.Application.getApplication();
    if (application) {
        application.addTweenManager();
    }

Please advice

Hi @Enriqueto,

You need to update your tween.js library to the latest version, check here:

3 Likes

The Tween Library is updated.
Find the tween.js in your project. Delete it and upload the new tween library. It will solve this issue.

Download the tween.js from here or Github.

1 Like