For example in World of Warcraft you can target a player and everyone can see who you are targeting.
I could write something like this
Now when the server has a new target I want the client to also know the target, how do I do this?
If I do
The editor just crashes.
*Player is a NetworkBehavior.
...
How do I synchronize GameObjects or Components?
I could write something like this
Code (CSharp):
- Player targetPlayer;
- //or
- GameObject targetGameObject
If I do
Code (CSharp):
- [SyncVar]
- Player targetPlayer;
*Player is a NetworkBehavior.
Code (CSharp):
- [SyncVar]
- GameObject targetGameObject;
How do I synchronize GameObjects or Components?