#Slot machine
1 messages · Page 1 of 1 (latest)
Nice. But this only works in 3d space right?
Yes, you can use 3d elements in 2d game too tho
Thats the easiest way I know of. You could do it with sprites too (in that case Id actually do with shaders) but its bit harder
I can give more in depth tips to implements those if you want. Just pick the method you want to use
Actually
wouldnt it be easier to make like a sprite system so every "block" or "sprite" has its own ID and u can infinite let them spin ?
Instead of a cylinders with static 7 items
I mean maybe not easier, but more expandable
In some way yes
@faint magnet so do you want me to explain the way to implement that bit further?
Ye would be great
The last time i used Unity was like 2 years ago. Thats why i know how some things work
but i cannot get my head around this anymore and my head hurts
Where are u from btw?
So first in the script you would create those tree reels which could be just list of transforms each (like list of 7 transforms or so which represents the stickers)
Then you can make a variable lets call that p (for each reel) that represents the rotation of the reel. when p = 0, the first sticker is on top, when p = 1, its one sticker down and so on. Using the p value you can calculate the position of the first sticker. You can use the remainder operator (%) to make the position loop when its on the bottom. You can make for loop that iterates thru all the transforms and makes the y position the position of the first sticker + i % 7 (these exact values only works if the stocker height is 1 and theres 7 stickers in total) so the other stickers loops too where i = 1 for second sticker, 2 for third etc. Now just by increasing the p you can loop all the stickers of the reel at once
You could use sprite masks or custom shaders to hide the stickers out of the "window" of the slot machine