#Problem of synchronisation when a server only and clients whereas OK when A host and some clients

5 messages · Page 1 of 1 (latest)

glad fulcrum
#

Hie: I want locals players to change some of their properties and inform server that will synchronise the relative player in the others players scenes. I did that with comman synchvar and RPC and it works very well when I have a host and some clients.
But when I have a server only and some clients the synchronisation is haveing errors.

I spend a lot of time trying to figure out what's happen.
Here the error I get on the client:
RPC Function System.Void PhyControllersNameSpace.M_Sail::ClientSetSailOnBool(System.Boolean,System.Boolean) called without an active server.

I do not succed to find the problem
Does someone have an idea where this problem comes from?

All my best and thanks for help

stable sparrow
glad fulcrum
#

Hie: I have a sync var (CoG for example) with a sync direction: "Server to Client" and a Sync mode :"Observer") The local player change the Cog using a keybord key, then a Command is called by the client local player to change the color variable on the server.

[Command]
void CmdCoG(float OldValue, float NewValue)
{
CoG = NewValue;
}

as the variable is declared with a hook
[SyncVar(hook = nameof(ClientCoG))]
public float CoG;

the RPC ClientCog is called by the server on the other client
[ClientRpc]
private void ClientCoG(float OldValue, float NewValue)
{
CoG = NewValue;
}

This works perfectly if I have a Host and some clients, but raise errors if I have A server only and some clients.
The error raised is RPC Function called without an active server.

Do you have an idea on the reason?
Thanks for your kind help

glad fulcrum
stable sparrow