• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating a "Wheel of Fortune" wheel with moving arrow

New Here ,
Apr 03, 2019 Apr 03, 2019

Copy link to clipboard

Copied

I'm creating a wheel with pegs that will spin and as they make contact with the pointer, it will be pushed by the pegs and snap back into position. I'm having problems coming up with a solid solution on how to best achieve this effect. My current solution is to run a for loop to test a collision of each peg, then tell the pointer to look at the peg till the collision is false. On that note it will fall back into place. The 2 main issues are:

• If the wheel spins too fast, the pegs can likely skip over the arrow. My idea currently is to detect motion of the wheel spin and if over an amount, tell the arrow to angle as though it had been hit.

• When the arrow makes contact it will do a small snap, as the body of the arrow is wider in certain areas and the peg needs to be pushing it based on where it's sliding against the arrow. It's not too drastic as it's near the tip, but I want a more realistic look here.

Are there any tutorials or tools that can achieve this? I haven't found any examples to pull from on achieving this simple effect.

TOPICS
ActionScript

Views

940

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 04, 2019 Apr 04, 2019

Copy link to clipboard

Copied

LATEST

If you aren't already, I would recommend using Greensock's ThrowProps plugin for achieving this.

As the wheel spin around you could check the pointer's coordinates and current speed with help from the tween's onUpdate function.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines