Search code examples
javascripthtmlcanvasgsap

GSAP "Cannot create property on number" error


so I am trying to rebuild this canvas peace which has Gsap powered animation in it. https://codepen.io/fcordillot/pen/xRdEPx

I tried to build my own code for this as you can see here

But when I add TweenMax code to the if statement on the line "105" I start getting errors. Can someone help?

You can see the TweenMax code commented above the if statement This is what I have: https://codepen.io/lukagurovic/pen/WLWbKQ

if(dist <= HOVER_RADIUS) {
        this.inHoverRadius =true;
        TweenMax.to(c, 0.4, {scale: 2} )
        TweenMax.to(c, 2, {scale: 2} )

Solution

  • It looks like the target was incorrect - you were trying to tween a "scale" property of a number. The answer was already posted here: https://greensock.com/forums/topic/19696-cannot-create-property-_gstweenid-on-number-570/

    Happy tweening!