Skip to content

Commit 1f09ee2

Browse files
committed
Fixed bug with enemies in quests being culled
1 parent da64322 commit 1f09ee2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Assets/Scripts/Game/Questing/Actions/CreateFoe.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ public override void Update(Task caller)
166166
void CreatePendingFoeSpawn(Foe foe)
167167
{
168168
// Get foe GameObjects
169-
pendingFoeGameObjects = GameObjectHelper.CreateFoeGameObjects(Vector3.zero, foe.FoeType, foe.SpawnCount, MobileReactions.Hostile, foe);
169+
Vector3 inactiveSpawnPos = GameManager.Instance.PlayerController.transform.position + Vector3.up * 4f;
170+
pendingFoeGameObjects = GameObjectHelper.CreateFoeGameObjects(inactiveSpawnPos, foe.FoeType, foe.SpawnCount, MobileReactions.Hostile, foe);
170171
if (pendingFoeGameObjects == null || pendingFoeGameObjects.Length != foe.SpawnCount)
171172
{
172173
SetComplete();

Assets/Scripts/Game/Utility/FoeSpawner.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ void Update()
5656
if (FoeType != MobileTypes.None && FoeType != lastFoeType && SpawnCount > 0)
5757
{
5858
DestroyOldFoeGameObjects(pendingFoeGameObjects);
59-
SetFoeGameObjects(GameObjectHelper.CreateFoeGameObjects(Vector3.zero, FoeType, SpawnCount, alliedToPlayer: AlliedToPlayer));
59+
Vector3 inactiveSpawnPos = GameManager.Instance.PlayerController.transform.position + Vector3.up * 4f;
60+
SetFoeGameObjects(GameObjectHelper.CreateFoeGameObjects(inactiveSpawnPos, FoeType, SpawnCount, alliedToPlayer: AlliedToPlayer));
6061
lastFoeType = FoeType;
6162
}
6263

0 commit comments

Comments
 (0)