浏览代码

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. 二进制
      demos/3d/platformer/enemy.scn

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

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

二进制
demos/3d/platformer/enemy.scn