소스 검색

Properly free enemies after death in 3d platformer demo.

Previously, they stuck around as invisible physics objects. This fix is much
cleaner than my previous attempts, as it uses the ability to call a function
from an animation as is done in the 2d platformer demo.
Eric R. Monson 10 년 전
부모
커밋
f0119c2e3c
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      demos/3d/platformer/enemy.gd
  2. BIN
      demos/3d/platformer/enemy.scn

+ 2 - 1
demos/3d/platformer/enemy.gd

@@ -91,4 +91,5 @@ func _ready():
 	# Initalization here
 	pass
 
-
+func _die():
+	queue_free()

BIN
demos/3d/platformer/enemy.scn