我正在使用带有MotionPathPlugin和PixiPlugin的GSAP来让我的正方形遵循一条路径。我已经将autoRotate设置为true,但似乎有一个bug,正如您在GIF中看到的那样。看起来我的精灵有点旋转过度了。路径是一个由{x, y}值组成的数组。
我还尝试像autoRotate: ['x', 'y', 'angle', 90, true], // 4th param is angle in rad一样使用autoRotate的数组方法
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,
},感谢您的任何意见。

发布于 2021-06-18 07:06:47
经过多次搜索,我发现我需要在MotionPath vars选项中输入useRadians: true,。
gsap.to(sprite, {
motionPath: {
autoRotate: 1.5708,//in radians, offset rotation by 90 degree
path: values,
curviness: 0,
useRadians: true,
},
}

https://stackoverflow.com/questions/68027213
复制相似问题