Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

How do I synchronize GameObjects or Components?

$
0
0
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

Code (CSharp):
  1. Player targetPlayer;
  2. //or
  3. GameObject targetGameObject
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

Code (CSharp):
  1.  
  2. [SyncVar]
  3. Player targetPlayer;
  4.  
The editor just crashes.
*Player is a NetworkBehavior.


Code (CSharp):
  1.  
  2. [SyncVar]
  3. GameObject targetGameObject;
  4.  
...

How do I synchronize GameObjects or Components?

Viewing all articles
Browse latest Browse all 16796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>