Making same prefab appear different based on @export setting

Godot Version

4.5

Question

I have a Node2D prefab with a script attached. It has a Sprite2D as a child. I would like to be able to instantiate this prefab in another scene while in the editor, and have its Sprite2D child change its appearance depending on what one @export setting is. Is there a way to do this? How can I do this?

Of course it’s possible. Basically anything is possible in Godot.

What difference in appearance are we talking about specifically? Just different sprite, or something else?

On a side note, a Prefab is a Scene in Godot lingo, so it’s better to use that word in Godot context to avoid confusion.

Thanks for the side note–I knew prefab was a Unity word, but I didn’t know the matching terminology.

Since this is just the editor, I want to have a way to just change what the scene looks like. In all honesty, it’s just important for me to see a visual difference, so it would be just as good for any other way to change the display.

The easiest way is to right click on your Scene in the SceneTree and select Editable children. The you can edit the child Sprite2D however you like.

See if that suits your needs.