I’m trying to make a history trivia game with turn-based RPG elements. A problem I am currently working on is resetting the battle scene node when battle finishes so it can be reused for the next enemy.
Here’s what I’ve tried to reset it:
var battle_screen = preload("res://Battle Scene Level 2.tscn")
var t = battle_screen.instance()
func _on_Proceed_pressed():
if t:
t.queue_free()
t = battle_screen.instance()
add_child(t)
I can’t manage to get it to work. Help would be greatly appreciated!
Edit: The battle scene is already present in the tree so an instance of it exists when I start the game.