Question by
FRBDN1 · Dec 07, 2017 at 03:27 AM ·
networkingnullreferenceexceptionfindgameobjectwithtag
FindGameObjectWithTag not working after integrating networking
I have two C# scripts, one that is on an enemy and another on the player.
The player scripts has enemyDamage = GameObject.FindGameObjectWithTag("Skeleton").GetComponent().skeletonDamage. Now when I had just one player everything was working fine. Now however, after adding the networking stuff that line is throwing a NullExceptionError and I have no idea why.
All the scripts are now NetworkBehaviour and I have NetworkIdentities on both the player and enemy and a NetworkTransform on the enemy and player. The variables have [SyncVar] above them.
Am I missing something else?
Thanks in advance.
Comment