Multiplayer variable synchronization issue

Hi everyone,

I am having an issue with a multiplayer project using CoBlocks where a conditional check based on variables isn’t triggering an action, even though the variables appear to change correctly for the players.

What I want to achieve: I have a 2-player multiplayer session. When the item Circle is clicked, I want the project to detect who clicked it.

  • If the Host (É anfitrião) clicks it, the variable P1 should become true (verdadeiro).

  • If the Guest (senão) clicks it, the variable P2 should become true (verdadeiro).

  • Once both variables (P1 and P2) are true, an information panel should pop up.

The Problem: As you can see in the 3D view, both text panels display “true”, meaning the variables are successfully being changed to verdadeiro by the respective players. However, the repeat forever (repetir indefinidamente) loop containing the condition if P1 == true and P2 == true never triggers the information panel.

It seems like the variables P1 and P2 are being updated locally on each player’s client, but they are not syncing across the network to validate the and (e) condition together.

My current code structure (as shown in the screenshot):

  1. On start: P1 and P2 are set to false.

  2. When Circle is clicked: Splits into if host / else to set P1 or P2 to true and update the local text signs.

  3. In a separate parallel block (Executar separadamente): A continuous loop checks if both P1 and P2 equal true to show the info panel.

Is there a specific way to force variables to sync globally in multiplayer, or a better workaround to check conditions achieved by different players in the same session?

Any help or insights would be greatly appreciated!

Thank you!

Hi @Alanroger92 thanks for your question!

Variables are not synced across clients. We’d recommend modifying the color, name, or position of the objects and use these to check conditions across different players.

Hope this helps!