From 9119c9b31deb2ceb70f089f75493250b9c68fda9 Mon Sep 17 00:00:00 2001 From: LPLafontaineB Date: Wed, 4 Jan 2023 13:49:30 -0500 Subject: [PATCH 1/2] updating NetworkVariable after the NetworkObject is spawned --- Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs b/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs index dd344b2df..0bede2154 100644 --- a/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs +++ b/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs @@ -152,8 +152,8 @@ void Update() GameObject powerUp = m_ObjectPool.GetNetworkObject(m_PowerupPrefab).gameObject; powerUp.transform.position = pos; - powerUp.GetComponent().buffType.Value = (Buff.BuffType)Random.Range(0, (int)Buff.BuffType.Last); powerUp.GetComponent().Spawn(true); + powerUp.GetComponent().buffType.Value = (Buff.BuffType)Random.Range(0, (int)Buff.BuffType.Last); } if (Asteroid.numAsteroids == 0) From 01144a04c411e2b1564b85ba1bf83859871bfe3f Mon Sep 17 00:00:00 2001 From: LPLafontaineB Date: Wed, 4 Jan 2023 13:55:14 -0500 Subject: [PATCH 2/2] Added changelog entry --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f7b2d8fe..018317f6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [unreleased] - yyyy-mm-dd +### 2DSpaceShooter + +### Fixed +- Removing warning when spawning powerups (#90). Fixed the order in which powerups were spawned and when their NetworkVariable value was initialized. Now they are spawned beforehand. + ## [1.1.0] - 2022-12-13 ### Client Driven