Open developer-av opened 6 years ago
The same question.
I need to adjust the direction of the car as it moves.
I tend to use _tmpPoint
If you log the result of a path you will find it attached to the TweenPath object. For example:
const tween = PIXI.tweenManager.createTween(sprite);
tween.path = new PIXI.tween.TweenPath();
tween.path.moveTo(10, 200).lineTo(200, 200); // draw your path
tween.on('update', () => {
const current_point = tween.path._tmpPoint;
const rotation_to_point = Math.atan2(sprite.y - current_point.y, current_point.x - sprite.x);
sprite.rotation = rotation_to_point
});
tween.start()
Hi, how can I find out the current animation point?