Search Unity

Question netcode problem with grid layout group

Discussion in 'Netcode for GameObjects' started by FARAHhakim, Oct 18, 2022.

?

netcode problem with grid layout group

  1. client authority

    0 vote(s)
    0.0%
  2. use local prefabs

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. FARAHhakim

    FARAHhakim

    Joined:
    Sep 19, 2021
    Posts:
    2
    hi
    i have an issue with netcode, iam trying to spawn a bunch of prefabs and asign them to a parent, this parent has a grid layout groupe in order to set them in a spécifique alignement .
    in the server side things works great, but in client side , the parenting is acured but all generated prefabs are pilled on 0 ,0,0 coordination and dont use the grid layout component
     

    Attached Files:

  2. FARAHhakim

    FARAHhakim

    Joined:
    Sep 19, 2021
    Posts:
    2
    addtitional image
     

    Attached Files:

  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    There's no need to network individual UI elements. In a card game like this, you would have lists of cards - the hand of each player and the decks. Based on that information of hands and decks distributed among clients via Netcode, you build your card UI for each client completely outside of any networking code.

    The cards themselves needn't be network objects. If a client plays a card and it should animate, ie moving to a deck or the table and become visible to all, you'd send a "playing card X" RPC to the server who verifies that this is possible, then relays this info to all clients (including the one trying to play the card) so that all the clients play the same animation at the same time.