Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | 21sully |
func swap_slots(i,j):
var slot1 = heroes[i].get_parent()
var slot2 = heroes[j].get_parent()
slot1.remove_child(heroes[i])
slot2.remove_child(heroes[j])
slot1.add_child(heroes[j])
slot2.add_child(heroes[i])
I’m making a turn-based game similar to darkest dungeon, where the heroes can change the slot they’re in during battle.
the slot transition works, they do go to different parents (slots), but in-game the heroes just stay in the same place. I want them to swap places in-game, not just in the node tree. any help would be much appreciated.