Exported Texture2D property not showing up in inspector

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?

You needed add tool parametr to your scripts

Or you want keep changes from game then you needed save node.

That didn’t fix it. I did some more testing and no matter what I try to export, even strings or integers, don’t show up in the inspector.

Did you compiled sceipts in godot editor with no errors?
Godot 4.3 already have reminder for that:)

1 Like

Wow I feel really dumb now… that was exactly it :man_facepalming:

1 Like

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