I had an issue when I freed my agent with a BTPlayer with monitor_performance = true, it would crash the game completely with no error message.
I attached a minimal example. If you run main.tscn and click "spawn agent" and then "free agent bad", it should crash immediately with no error message (or it might take a few tries). If you spawn an agent and then click "free agent good" it doesn't crash.
This is with the version from the asset store (included) and Godot 4.2.2 (15073afe3)
I also copied some of this logic (below) from the demo code and it still crashed, but I didn't include any of that in this minimal example.
func die() -> void:
if _is_dead:
return
death.emit()
_is_dead = true
root.process_mode = Node.PROCESS_MODE_DISABLED
animation_player.play(&"death")
collision_shape_2d.set_deferred(&"disabled", true)
for child in get_children():
if child is BTPlayer or child is LimboHSM:
child.set_active(false)
if get_tree():
await get_tree().create_timer(10.0).timeout
print("freeing")
queue_free()
I had an issue when I freed my agent with a BTPlayer with monitor_performance = true, it would crash the game completely with no error message.
I attached a minimal example. If you run main.tscn and click "spawn agent" and then "free agent bad", it should crash immediately with no error message (or it might take a few tries). If you spawn an agent and then click "free agent good" it doesn't crash.
minimal example: godot_crash.zip
This is with the version from the asset store (included) and Godot 4.2.2 (15073afe3)
I also copied some of this logic (below) from the demo code and it still crashed, but I didn't include any of that in this minimal example.