Hey Everyone!
Im trying to make a slot machine using canvas UI.
Not sure what they are called, but the 3 wheels that spin are composed of 2 sprites each. One on the top and one on the bottom. when the bottom sprite is no longer in view (Just below the slot window), it goes on top of the other sprite to simulate a never ending, spinning wheel.
To do this, I simply have an if statement that checks if the sprites transform.position.y is less than -420, and if so, then add 781 to its Y Position.
This was working great until I compiled it to my android (where the screen is smaller) that I found out a problem with this method.
When I change the size of my game window everything goes out of wack.
I think its because -420 is a different location when the screen is made smaller.
Also, I have the canvas set to scale with screen size, not sure if that has something to do with it
Can some smart person explain to me how can I overcome this problem?
EDIT:
At closer inspection, I see that when I change the size of the screen it doesnt detect its Y position on time, because step by step, i am able to see its passing -420