if a value of a variable is set on the server using [Command] for the local player is the value set on the local player locally?
I'm using a code of the following structure
public Gameobject x=null;
public bool hasValue=false;
[Command]
void Cmd_createSomeThing(){
x=Instantiate(prefab,position,rotation);
NetworkServer.Spawn(x);
}
void Update(){
if(!isLocalPlayer)
return;
if(x==null)
Cmd_createSomeThing();
hasValue=x!=null;
}
This code works perfectly for the host but not for the connected clients. The "hasValue" always is false for the local clients even though the value of "x" has some value in the inspector for the client player.
Your answer
Follow this Question
Related Questions
Day/Night cycle turns black at night and how to Serialize it rightly? 0 Answers
Photon Networking - How to move all players from game scene to current room scene? 0 Answers
Calling Bool in Network Command Not Working 0 Answers
How to choose different teams one by one 1 Answer
Mobile Interaction 0 Answers