So I linked a recording of my case system.
The thing is, I have absolutely no Idea how to check what skin have I obtained.
I tried Vector2 magnitude of the indicator (the red line in the middle of the case opening frame) with every single frame in the scrolling frame and making the drop predefined, but unfortunely none of these two options worked.
You should 100% have the drop pre-determined. Otherwise bad actors may manipulate the screen UI’s to change the drop to something more favourable.
When the client opens a case they should be provided the list of all items obtainable as well as the item they actually got. If you want to do it in the same way you got it now, you could do the following:
Say you have 10 different items in the case. 1. Client requests to open a case 2. Server decides which item was won and sends it (possibly along with case conents) to the player 3. The player randomly creates a case with the item types in the case, with the obtained item being any of the items being the correct type 4. UI is tweened to the selected item
Case could look like this, where the number is which item type: [ 0, 9, 7, 3, 6, 3, 5, 2, 8, 1, 2, 0, 7, 5, 9, 8, 1 ], if you were to obtain the item of type #5, you’d tween until you get to the last 5. This is of course not perfect, as if you would have gotten the item #1 you’d have no more items to the right of it, but that can be solved by adding filler items after it
Yeah drops should be pre-determined, the effect should only be a cool little animation, and if this is for some reason client sided then exploiters can just send false information and say that they won something they didn’t.
However I found yet another problem. When I tween ScrollingFrame’s CanvasPosition to the absolute position of the frame, it doesn’t really end up on the predefined item.