Skip to content

Commit

Permalink
fix(NetworkBehaviour): fixing find identity if parent gameobject is d…
Browse files Browse the repository at this point in the history
…isabled
  • Loading branch information
James-Frowen committed Oct 12, 2021
1 parent ddaa0a1 commit 04700f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/Mirage/Runtime/NetworkBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public NetworkIdentity Identity
// GetComponentInParent doesn't works on disabled gameObject
// and GetComponentsInParent(false)[0] isn't allocation free, so
// we just drop child support in this specific case
if (gameObject.activeSelf)
if (gameObject.activeInHierarchy)
_identity = GetComponentInParent<NetworkIdentity>();
else
_identity = GetComponent<NetworkIdentity>();
Expand Down

0 comments on commit 04700f9

Please sign in to comment.