# How do I make the Pin of a "wheel of fortune"?

0 favourites
• 3 posts
From the Asset Store
A "Wheel of Fortune" styled combat engine "In-Game Module" (IGM) for Action/Adventure, RPGs, and Rogue-like Games.
• Hey everyone,

I've made a simple "wheel of fortune" with 8 fields. Spinning the wheel and getting the right rewards works so far. On top of the wheel there is a small "Pin" which shows what you won. Now my question: How can I rotate this little pin when it hits the separaters of the rewards of the wheel while the wheel is rotating?

The wheel rotates with the "Rotation" behavior. I've already tried to make the collision polygon of the wheel like it only has collisions on these separaters. But which behaviors do I have to add to the Pin so that it stays always at the same position but rotating like 20 degrees to the right when it hits the collision polygon of the wheel? Is there any easy way to do this?

Thanks for any help!

• There's lots of ways to do that. My preferred way would be a timeline since I think it's the most flexible. Animate the rotation back and forth using like 2 keyframes. Then on collision play the timeline. I think you can even set it to loop. If the wheel has different speeds, you could adjust the playback speed of the timeline to match the speed of the wheel.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Thanks for the help, I've already solved the problem. I've added the Rotate-Behavior to the Pin and on collisions I set the Pin's rotation speed to the negative wheel's speed for x seconds (depending also on the wheel's speed) and then for the same period of time the negative speed so it gets back to it's normal position. After trying a bit and setting the right times it looks pretty nice now and also performance isn't a problem with that method :)

But maybe your method would have been a bit easier to do.

Thanks!

• 3 posts