Drag/Drop UI in UNET

HI, I create my new project and I have small problem.
I use function:

public void OnBeginDrag(PointerEventData eventData)
public void OnDrag(PointerEventData eventData)
public void OnEndDrag(PointerEventData eventData)

And System work in server and client, but no synchronized… How to fix it ?

Server send —> Client - work

Client send —> Server don’t work ;/

This is very import for me. I stop. I can’t work next.

Sry my english not the best
Thank you for answer

I’m assuming this is a ScreenSpace Overlay? If so, why would you need it synchronized? :eyes:

because i want in order to server and client look this Game Object in real time . This game is cards game

Are we talking like a trading card game, or a classic card game?

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.

Have you tried using a networktransform? Thats the built in way to sync transforms over the network

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 . :wink:

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.