I would like to sync up a class member that contains a reference to another game object of the same NetworkBehaviour subclass. Usually, it's for keeping track of where the enemy is, and I want to keep a reference to it.
Here's the following code:
But just that code itself crashes Unity editor. Does that mean you can't keep track of an enemy unit in a multiplayer game? Are there any other...
How to use [SyncVar] on NetworkBehaviour subclasses?
Here's the following code:
Code (CSharp):
- public class Foo : NetworkBehaviour {
- [SyncVar]
- public Foo enemy;
- }
How to use [SyncVar] on NetworkBehaviour subclasses?