RoomObject vs RPC

Options

Hey,

I built a lobby and assigned custom room properties that describe the role of each player in the room (i.e. tank, dps, heal)

When a player enters a room I want to instantiate a panel for each role (could be multiple from the same role). If I instantiate a room object it spawn outside the UI hierarchy.

Is there a way to spawn a room object under a specific transform on each client? Should I use RPC instead?

Thank you!

Answers

  • Tobias
    Options

    There will be some way to do what you need but we don't provide one out of the box. Sorry, I can't really help with this specific question (it is game specific, not really a PUN question).

    Don't use RPCs for game state.

  • Asari
    Asari
    edited January 2023
    Options

    That helps also.

    I ended up instantiating a panel as a RoomObject and sending it's photon view id by RPC, so the other client could locate a place it in their UI hierarchy.