Is it possible to detect which collider, out of two, overlaps the triggerbox the most?

Hi,

I’ve made a ‘Price is right’ type of wheel that spins and has different logos on each face. Each logo has it’s own collider that sticks out and passes through a triggerbox. When the wheel stops, the collider that is within the triggerbox activates whatever the corresponding logo does.

The problem is that sometimes there’s two colliders, corresponding to two different logos, that are inside the triggerbox when the wheel stops and that activates two logos at once, which is not optimal.

Is it possible to detect which collider, out of two, overlaps the triggerbox the most? I’ve looked it up and I can’t seem to find anything on that particular issue.

Thank you in advance.

Maybe your setup is too complicated to begin with. Since your logos are on a wheel and assuming they have identical sizes, why not check the wheel rotation angle instead?

2 Likes

You could retrieve the distance from arc centre of the colliders to the triggerbox.
For example: https://imgur.com/a/s4YrV0A

1 Like

wouldn’t it be easier to know the outcome upfront by choosing at random from a list of choices and make the wheel animate towards that logo? No physics or triggers needed…

1 Like

The outcome needs to be random each time

That could work. I’ll look into it. Thanks :slight_smile:

You mean check at what the angle the wheel is when it stops and assign angle properties to each logo and activate the functions when a logo’s angle property is hit? I guess that could work as well :slight_smile: I’m not sure how to go about assigning an angle properties to each logo though. But that’s something to go on, thanks :slight_smile:

what I suggested has nothing to do with the randomness off the outcome, rather with how you get that outcome.
I think that getting a random value from a wheel of fortune is easier when you know the random value upfront and just rotate the wheel to that randomly chosen logo, instead of trying to mimic a real world wheel with physics and triggers and what not, because the way you want to do it brings problems with it, which is the reason you are now here looking for help. Check this link for a tutorial : http://www.theappguruz.com/blog/how-to-make-a-wheel-of-fortune-in-unity-the-easiest-way

2 Likes

Ah I see what you mean now. Thanks for the tutorial and suggestion, I’ll give it a try