I create cards game “Mr” I don’t know good translate english. You have 9,10,…K,A - 24 cards. Won who first drop cards. Of corse 9<10<J<Q<K<A. If you don’t have high cards must draw 3x cards by the table
If I end this game. I think create other game cards ;).
Okay. So classic card game. Honestly, trying to synchronize position of cards across the network is asking for trouble. In most online card games the player views their hand at the bottom of the screen and their opponent’s cards are at the top of the screen with the backside viewable (so you can’t see the player’s hand). Instead of synchronizing card position, why not just create an animation that plays when a player plays a card. The animation could show a card moving from the player’s hand, into the center of the “table”. Then at the center of the table you could have UI image placeholders that are populated with the actual image of the card the players play. The image placeholders would then be the only thing that needs to be synchronized and you can accomplish this by having a SyncVar of type Int that represents which card’s image should be loaded into that placeholder.
DRRosen3
Hm… I must make card onClick and Play animation client and server? I understand error bad show, but it is impossible use position/parent network drag/drop? It looks nice .
jRocket
Yes, when add networ transform work
server send → client , but don’t work client send → server. This is my problem ;/
Trying to understand your English as best I can. Yes, you’d need to do an OnClick…sort of. I’d personally go about it using a Command to let the server know which card I choose. Then after the server checks (for things like valid choice, or cheating, etc) I’d send some sort of message to all the players. Whether it was my turn or my opponents turn, the animation played would be slightly different. Drag/Drop isn’t entirely impossible, just there’s much work you’d have to do.
I’m sory my english no the best ;/
I understand, I first create easy click (I add button component in card prefab) who change (only) parent, because I made my cards in UI and Layout Group (Sort).
Can you have idea synchronized parent?
Can I use [SyncVar] in Transform variable?
if I end all project (this game) later test animation and finish test Drag/Drop in network
Can you reading/links Drag/Drop in network?
Of corse, thank you very much for answer. In my problem.