How to use FileDialog to change texture?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kukuism21

I’m rather new godot. My project is to change the texture of a rectangle with a .png file from file dialog. I’m not so sure how to carry on with it and looked up as many tutorials and articles but found nothin that helps with my specific problem. Any suggestions? Thanks! This is the code I have so far. It’s kind of embarrassing to show but it’s what I have so far.

func _on_Upload_pressed():

func _on_OpenFile_file_selected(path):
var profile =, 1)

1 Like
:bust_in_silhouette: Reply From: Skyfrit

Here is the code:

var image =
var image_texture =
$TextureRect.texture = image_texture