Why doesn't the script @export work when I create an ImageTexture resource?

Godot Version

4.3

Question

_init happens before @exports

1 Like

Is there any way for me to use export?

How do you want to use it? Not in _init

I want to do likethis.

You can update the image when the exported variable is set:

@export var path: String = "...":
    set(v):
        path = v
        _update_image()

func _update_image():
    var image = Image.new()
    image.load(path)
    # The rest of the code ...

Thank you very much. It’s very useful.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.