Hello,
i´m try:
http://docs.unity3d.com/ScriptReference/Networking.CommandAttribute.html
but get warning from unity editor:
error CS0103: The name `isDirty’ does not exist in the current context
Is that example out of date?
Without “isDirty = true” its working without warning, but then edit the gameobject only on the server the position, not on the client side.
How i can say to the server, that he send the new info back to the client after change the value from the example inner the [Command] line?
Thanks.
Edit:
Its working fine with [SyncVar], but why they dont add it at the example?
Think can use isDirty for an easy way to say refresh the value at the clients… hm.
Inside of the Command, you could just call an RPC that will send the values to the clients.
1 Like
Okay, then i have really do nothing wrong.
i think its my fail thats not work.
Thank you for your answer. At the moment i dont know then how with the new rpc inner the command. I can the classic way from the old unity version with [RPC]…
The same, i must looking how i can change only one variable at one client and thats not sending to all other from the server. But, good to know i have make nothing wrong. Have try and try and dont understand why isDirty not work. Now i can looking continue for alternative. Thx.
Think, i have found what do you mean.
Server say: RpcUpdateUnitPosition()…
Client have [ClientRpc(channel = 0)] void RpcUpdateUnitPosition()…
https://unionassets.com/blog/new-network-subsystem-unity-5-unet-authoritarian-architecture-project-456