GSAP 与 MotionPath 和 autoRotate 不工作

GSAP with MotionPath and autoRotate not working

我将 GSAP 与 MotionPathPlugin 和 PixiPlugin 结合使用,使我的方块遵循路径。我已将 autoRotate 设置为 true 但似乎存在错误,如您在 GIF 中所见。好像我的精灵有点过度旋转了。 路径是 {x, y} 个值的数组。

我也尝试过使用数组方法 autoRotate autoRotate: ['x', 'y', 'angle', 90, true], // 4th param is angle in rad

            motionPath: {
                autoRotate: ['x', 'y', 'angle', 90, true], // 4th param is angle in rad
                alignOrigin: [0.5, 0.5],

                // autoRotate: true,
                align: values,
                path: values,
                curviness: 0,
            },

感谢您的任何意见。

经过大量搜索,我发现我需要在 MotionPath vars 选项中 useRadians: true,

        gsap.to(sprite, {
            motionPath: {
                autoRotate: 1.5708,//in radians, offset rotation by 90 degree
                path: values,
                curviness: 0,
                useRadians: true,
            },
        }