When using the Dialogue Manager addon on Godot, I am trying to run a function to change the sprite of a character. My function look like this under my character script:
func ace_change_sprite(index):
print("EEE")
change_sprite(index)
and my dialogue looks like this:
~ start
: test
Ace: Hey Miyu!
do emit("AceUpdateSprite",3)
When I run this, it prints the "EEE" but it doesn't update the Sprite. My character script is AutoLoaded and I have tried using signals, but still got the same result of "EEE" being printed but nothing else happening.
My change_sprite
function is this:
func change_sprite(index):
$Sprite.texture = load(sprites_path + character_name + str(index) + ".png")
It works when I call it within the player script, changing the sprite, but when I call it outside it doesn't seem to work.
change_sprite
method either doesn't work or doesn't work the way you think it does. But I can't find a method with that name anywhere in the official Godot reference, so I assume it's a function that you either wrote yourself or that is provided by the dialogue manager addon. If it's your own function, please post the sourcecode. If it's a 3rd party function, please link to the documentation. \$\endgroup\$