Knots

Games ›› Prize Wheel ›› Components ››
Parent Previous Next

Knots


These are the dowels pinned to the wheel border.


If the selector is not set to be anchored to the center, then it will collide with the knots to simulate the slowing down and flapping effect.


You can add as many knots as needed or none if the selector is not meant to flap.


To setup knots, just add objects to the Knots array in the PrizeWheel component. Make the knot objects be at the right distance from the center so that they match the wheel dimensions or the intended ratio for the knots.


Once the mini game is executed, it will distribute all knots uniformly on the wheel and will add an extra angular offset as defined by the property PrizeWheel.InitialKnotOffset.




Knots

This is the root node of all Knots. All knots should be child of this object in the hierarchy.

Only enabled objects will be used as knots.

Knots Offset

By default, knots are distributed around the wheel. This variable adds an offset to the first knot. So, if knots are placed every 30 degrees, and this value is set to 5 degrees. Then knots are placed at: 5, 35, 65, 95, etc.

This is useful to make knots aligned to the center of the elements instead to the beginning. Just add an offset equal to half the element angular size.

Collision Sounds

Every time the selector hit's a knot, it will pick a random AudioClip from this array and play it.

Min Volume

To make the sounds more random, the volume can be random as well. So that even when the same audio clip is used, it will sound different.

volume = Random( Min_Volume, Max_Volume)

Max Volume

Play Knot Sound

When a sound should be played, this callback is used. Normally it should be referencing the PlayOneShot function of an AudioSource.

However, if you are using a custom audio solution to play the sounds, this can be used to call your own functions.




Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents