diff --git a/Assets/Mirror/Tests/Editor/InterestManagementTests_Distance.cs b/Assets/Mirror/Tests/Editor/InterestManagementTests_Distance.cs index ba16bf9e1..de66640a5 100644 --- a/Assets/Mirror/Tests/Editor/InterestManagementTests_Distance.cs +++ b/Assets/Mirror/Tests/Editor/InterestManagementTests_Distance.cs @@ -11,18 +11,19 @@ public class InterestManagementTests_Distance : InterestManagementTests_Common [SetUp] public override void SetUp() { - GameObject go = new GameObject(); + base.SetUp(); + + // create AOI GameObject + CreateGameObject(out GameObject go); aoi = go.AddComponent(); aoi.visRange = 10; // setup server aoi since InterestManagement Awake isn't called NetworkServer.aoi = aoi; - base.SetUp(); } [TearDown] public override void TearDown() { - GameObject.DestroyImmediate(aoi.gameObject); base.TearDown(); // clear server aoi again NetworkServer.aoi = null;