diff --git a/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs b/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs index ae01075..5d639a9 100644 --- a/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs +++ b/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs @@ -154,8 +154,6 @@ namespace Passer.Humanoid { else name = humanoid.gameObject.name; - // Bug: - // The siteLocation should not be calculated dynamically every time because we could have moved to a new site! if (humanoid.remoteAvatar == null) { Possessable avatarPossessable = humanoid.avatarRig.GetComponent(); if (avatarPossessable != null) diff --git a/Runtime/Sites/Scripts/Possessable.cs b/Runtime/Sites/Scripts/Possessable.cs index 5579bb3..93b61fa 100644 --- a/Runtime/Sites/Scripts/Possessable.cs +++ b/Runtime/Sites/Scripts/Possessable.cs @@ -42,14 +42,18 @@ namespace Passer { /// public bool isUnique = false; + private string _siteLocation; public string siteLocation { get { - if (SiteNavigator.currentSite == null) - return ""; + if (_siteLocation == null) { - string siteLocation = SiteNavigator.currentSite.siteLocation; - //siteLocation = siteLocation.Substring(0, siteLocation.LastIndexOf("/")); - return (siteLocation + "_possessions"); + if (SiteNavigator.currentSite == null) + _siteLocation = ""; + + string siteLocation = SiteNavigator.currentSite.siteLocation; + _siteLocation = (siteLocation + "_possessions"); + } + return _siteLocation; } }