How to add animation to spinning wheel's indicator?

HI there, I’m brand new to phaser 3, and I’d been trying to create a spinning wheel game. With the examples i found, I am able to develop my game.

But, I am not able to add animation to my spinning wheel indicator. When the spinning wheel rotate, the indicator should be moving to the right alittle bit and back to original position as it is hit by the wheel.

Can anyone give me some advise on how could i do it? Been studying tween and physics from https://labs.phaser.io/ , still no luck…

You can probably do one of the following:

  1. create colliders for each “separator” on each piece of the “pie” and have them collide with the indicator to literally push it around.
  2. Turn the spinning wheel’s rotation into the indicator’s rotation by separating the spinning wheel’s rotation values into small range. For instance if you have a separator in every 90 degree position, you could be rotating the indicator from the wheel’s rotation range [85,95] and linearly interpolate through the values. It’ll need some testing but it sounds like fun :slight_smile:.

Good luck!

Thanks for sharing, I’ll try it out later today!