Hi!
I'm trying to use MotionPath with a custom javascript object to animate it in a 2D Canvas.
gsap.to(this.indicator, {
motionPath: {
path: [{x:0, y:0}, {x:20, y:0}, {x:30, y:50}, {x:50, y:50}],
type: "cubic"
},
duration: 5,
});
I've done that many times in the past with no problem but now I'm getting this error, which thrown every frame:
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at _parseTransform2 (gsap.js?v=e483ba29:3750:93)
at _get2 (gsap.js?v=e483ba29:3476:13)
at Object._saveStyle2 [as save] (gsap.js?v=e483ba29:3236:61)
at gsap.js?v=e483ba29:3240:28
at Array.forEach (<anonymous>)
at Object._saveStyle2 [as save] (gsap.js?v=e483ba29:3239:52)
at gsap.js?v=e483ba29:3295:18
at Array.forEach (<anonymous>)
at _getStyleSaver2 (gsap.js?v=e483ba29:3294:39)
at Plugin.init (gsap_MotionPathPlugin.js?v=e483ba29:1179:37)
It seems to me it's trying to treat my js object as an HTML element belonging to the DOM, which is not.
I'm using latest gsap version 3.12.5.
May it be a regression on the MotionPath plugin? Or maybe I'm doing something wrong? All the other 'normal' tweens/timelines I'm using are working fine.
Any help would be greatly appreciated, thanks in advance!