Wheel Configuration
Demo Scene
There are 2 demo scenes included, one in portrait and one in landscape mode. Simply start one demo scene and click on the spin button to start the wheel. Just make sure you have the proper game resolution set in your editor to display it correctly. (Portrait scene displayed in landscape wont look as it is intended to)
Lucky Wheel Configuration
You can find the centralized wheel configurator as the first GameObject in the scene
Spin Force
Define a range for the spin force. Spin force is applied to the Rigidbody of the wheel and defines how strongly you rotate the wheel.
Default Angular Drag
This value describes the standard angular drag of the wheel. This can be also considered as wheel friction. The higher the value, the more “friction” the wheel has and therefore will faster come to a stop
Angular Drag On Slowdown
After the configured max spin time (if the wheel hasn't stopped yet due to the default angular drag and spin force) the angular drag will increase so the wheel will come to a halt soon.
Stop Velocity Limit
Define the min velocity of the wheel that is considered as “still spinning”. If after you spin the wheel, the velocity gets below the defined limit, the velocity will be set to zero immediately and the reward claim will be triggered.
Max Spin Time
After the time is reached, the angular drag on slowdown will overwrite the default angular drag, so the wheel will come to a stop faster.
Spin Cooldown
Defines a cooldown that the user needs to wait after spinning the wheel until he can spin it again.
Reward Config
You can define the rewardType and the rewardAmount per entry.
When creating your own wheel with your own rewards, please make sure that there are as many rewards configured as there are reward sections on the wheel, otherwise you will get an error on wheel initialization.
Adding new Reward Types
This asset comes with a default and premium currency reward type with the option to add an arbitrary amount of new reward types to the wheel. The reward types are built with scriptable objects. So If you want to create your own reward type, you can do it pretty easy by right clicking somewhere in your project folder and selecting Create → SF Studio → WheelRewardType(2D)
Rename the created scriptable to fit your rewardType name and assign an icon and a saveId to your type:
The saveId is used as an identifier to save the given reward amount to the correct reward, via PlayerPrefs. If you want to change how and where the rewards are saved, please adapt the AddReward method in the WheelRewardType scriptable. This is located under Scripts → Scriptables. Then simply go to your Wheel in the demo scene and add (or change) a reward type in the Reward Config list.
Last updated