Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Exile152 |
how can i make when a enemy is killed (queue_free) a item (a scene) will appear where he died?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Exile152 |
how can i make when a enemy is killed (queue_free) a item (a scene) will appear where he died?
Reply From: | Asthmar |
call add_child(Scene) before you call queue_free.
And to make it appear where the enemy died you must also set the position before freeing
Scene.global_position = enemy.global_position
Example
func died():
var loot = Scene.instance
loot.global_position = global position
Add_child(“loot”)