Texture doesn't load correctly

Godot Version

Godot v4.4.1.stable

Question

Hey! I’m currently coding a match 3 game using this tutorial. I am new to Godot / gdscript so this might just be my stupidity.
My code currently looks like this.
This is my pieces script which every piece is inherrited to. Im calling the functions via my grid script in the function change_bomb (line 289).
In my function to change the textures

func make_column_bomb():
	print("col")
	is_column_bomb = true
	$Sprite2D.texture = column_texture
	print($Sprite2D.texture)
	print(column_texture)
	$Sprite2D.modulate = Color(1, 1, 1, 1)

the piece is just blank afterwards. My column_texture is a valid Texture2D. What is kind of strange is when i call the function from the _ready function the texture loads correctly for every piece.
output

also if i comment

#$Sprite2D.texture = column_texture

out the texture is not the old one but still empty.
My scenes and scripts are located here if that helps anyone.

Kind regards and thank you,
llwl

If it works when calling it inside _ready() and it’s blank when calling it after that or even if you comment out the place where you change the texture then the problem is in another place. There is a dim() function that scales down and changes the alpha to 0 so my guess is that it’s being called after you make the cell a bomb and that’s why it looks like it’s not working.

1 Like