Server+Client updating properly, but Client Only is not

Hello everyone.

I’m new to using Mirror. I’ve tried following several guides, and have a scenario that I still can’t figure out. I’m not even sure how to properly word my question / highlight my issue, sorry in advance.

I am basically just sending a Random number, that I want both players to be able to view. The Server+Client window is correctly updating a shared screen text / UI element, but the Client only window is not updating that same shared text properly.

The Server+Client player (Player303, in the top image here) has rolled a 4 and a 12. Both upper text elements update properly on both screens (bottom screen shows 'Player303 4 12, as expected) so both players can see the “Player303 4 & 12”
8132207--1054982--upload_2022-5-16_12-33-49.png

However, when player 2 (Player 116, who is in control of the bottom here) clicks their random button… it properly updates their OWN UI (to show the 5 and 1) but the SHARED text just above it, shows an invalid value of 6 and 6.
8132207--1054988--upload_2022-5-16_12-35-44.png

It is defaulting to the hard coded static float variables within the script itself, but only for the ‘shared’ text element. The non-shared, my-window-only text, does get updated as needed.
public float ran1 = 6f;
public float ran2 = 6f;

Why is it properly updating its own UI element with the ‘5 and 1’, on its own screen, but then sending the default 6 and 6 values to the shared text element above it? And only on the client, as it does not happen on the Server+Client window.

In the Scene Script, triggered by a UI button:
public void Ran_Button()
{
playerScript.ran1 = Random.Range(1, 20);
playerScript.ran2 = Random.Range(1, 20);

//update the UI with the new values
Value1Text.text = “” + playerScript.ran1;
Value2Text.text = “” + playerScript.ran2;

playerScript.RanButtonUpdate();
}

In the player script:
public float ran1 = 6f;
public float ran2 = 6f;
[Command] //[ClientRpc] using this seems to have no change
public void RanButtonUpdate()
{
sceneScript.statusText = $“{playerName} {ran1} {ran2}”;
}

Each UI is updated with the new random values, per the button click, but the shared text is not being updated properly - it just shows the default 6/6’s from “public float ran1 = 6f;”

Any thoughts?
Thanks all

Separately, but I still think related to my overall problem (which is a lack of a full understanding of networking), is this…


Player1 is on the left image, looking at player 2. Player 2 is on the right image, looking at player 1.

I put a child object (the white cube) on my player prefabs head. Each player can see their own cube, on their own head, on their own screen.

However, you do not see that same cube child object on the other player.

Notice the left screen/cube… that is where the player spawned in. To player 1, player 2’s cube hasn’t moved… but on player 2’s own screen, that same cube is properly on its head.

Why is it ‘correct’ on their own screen, but when another player views it, it hasn’t moved from spawn?

Regarding the second post here, the cube on the head…

Is part of the problem that the cube is a child of the player object?
8150627--1058774--upload_2022-5-23_15-34-51.png

Does this cause an issue because the character is part of the Network Manager script?
8150627--1058777--upload_2022-5-23_15-35-50.png

I’m trying to experiment now and figure out how to best cut it from being a child of the Monster-5 object and make it its own stand along object in the room - but why would this be required (if it even is)?

Is there something about it being a child and using movePointObj.transform.position = new Vector3(movePointLoc.position.x, yVal, movePointLoc.position.z); that is the problem?