Set a 2D UI lobby with rpc messages

Options

Hello,

I'm trying to make a lobby with 2d ui elements, where I show user names, colors etc.

The main problem I'm having is, since the player objects are gameobjects with RectTransform, I can't use networktransform but it also seems unnecessary since the change is not continous.

I want to use hosted architecture.

So I want to update player object's parent on all clients and on the host when a new player joins. I couldn't get the correct RPC calls to make it happen. Currently I can update it only on host but not on the clients.

Client can set itself to the correct parent, but I cannot send the info from previously joined clients/host to the new clients to also move those player objects to under correct transform.

Can someone help me understand this logic better please?

Answers

  • Tobias
    Options

    I don't understand why you couldn't have a NetworkObject (NO) on the objects?

    Are players choosing their position in the grid? If they don't, then it would be better to use some sort algorithm to organize the list. If this is sorted by name or player number, you don't really need to sync that.

    Maybe I don't get the use case yet.

  • Hi Tobias,

    I can have network object, I cannot have network transform. But I understand about the sort algorithm, I can derive that info from NetworkRunner.ActivePlayers I guess.

    After thinking more, I realize actually my problem is not understanding the RPC rules exactly.

    For example the documentation explains what an InputAuthority is but never explains StateAuthority. Is there a page that describes it?

    What could be the RPC definition if Host can call it and it executes on non-host clients?

  • ramonmelo
    ramonmelo mod
    edited February 2022
    Options

    Hi @hakankaraduman ,


    For example the documentation explains what an InputAuthority is but never explains StateAuthority. Is there a page that describes it?

    Please take a look here: https://doc.photonengine.com/en-us/fusion/current/manual/network-object#input_vs_state

    What could be the RPC definition if Host can call it and it executes on non-host clients?

    Please take a look at our RPC Doc Page for more info: https://doc.photonengine.com/en-us/fusion/current/manual/rpc


    --

    Ramon Melo

    Photon Fusion Team