Godot Version
4.2.2
Question
Hello, I have a Control node with Color, State and textureRect child nodes. I want to export a Texture2D property in my Control node script so that I can set the TextureRect texture from the inspector. However, the exported Texture2D doesn’t show up in the inspector:
Here is my code:
public partial class CardUI : Control
{
[Export]
public Texture2D Texture { get; set; }
private ColorRect color;
private Label state;
private TextureRect textureRect;
public override void _Ready()
{
color = GetNode<ColorRect>("Color");
state = GetNode<Label>("State");
textureRect = GetNode<TextureRect>("TextureRect");
textureRect.Texture = Texture;
}
public override void _Process(double delta)
{
}
}
I have already tried restarting Godot multiple times, could anyone help me with this?