# Tweening a Graphnode

**URL:** <https://forum.playcanvas.com/t/tweening-a-graphnode/18795>\
**Category:** Help & Support\
**Created:** [March 11, 2021, 1:12pm UTC](https://forum.playcanvas.com/t/tweening-a-graphnode/18795 "2021-03-11T13:12:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fus\_ion](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/fus_ion/32/14990_2.png) [@Fus\_ion](https://forum.playcanvas.com/u/Fus_ion)\
**Post date:** [March 11, 2021, 1:12pm UTC](https://forum.playcanvas.com/t/tweening-a-graphnode/18795/1 "2021-03-11T13:12:59Z")

</div>

I’m trying to tween a graphnode but whenever i edit tween.js i get an error, and whenever i fix the error it does absolutely nothing. does anyone have a solution to this?

* * *

```javascript
    // Add pc.Application#tween method
    pc.Application.prototype.tween = function (target) {
        return new pc.Tween(target, this._tweenManager);
    };

    // 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;
    };
    
    pc.GraphNode.prototype.tween = function (target) {
        var tween = new pc.Tween(target, pc.app._tweenManager);
        tween.node = this;

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

        return tween;    
    };

```
