From 851cdb7ead9b466760df322747dee4f278cbb854 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 4 Jan 2023 12:39:24 +0100 Subject: [PATCH] End of lifetime --- assets/Scripts/Game/Unit/Enemy/Enemy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/Scripts/Game/Unit/Enemy/Enemy.ts b/assets/Scripts/Game/Unit/Enemy/Enemy.ts index df7c957..befb18f 100644 --- a/assets/Scripts/Game/Unit/Enemy/Enemy.ts +++ b/assets/Scripts/Game/Unit/Enemy/Enemy.ts @@ -139,7 +139,7 @@ export class Enemy extends Component { this.endOfLifetimeTriggered = true; - while (this.node.active) { + while (this.node?.active) { this.sprite.node.active = false; await delay(200);