+4 votes

I'm building a plugin and I want one of my custom nodes to show the warning sign when some of the properties are not set properly.

Is there any way to do that?

in Engine by (24 points)

2 Answers

+1 vote
Best answer

There is a virtual method Node::get_configuration_warning in cpp.
but it's not exposed to gdscript.

I'm not sure if there is any workaround for it.
you can open issue and discuss about this on github.

https://github.com/godotengine/godot/issues

by (9,664 points)
selected by

I opened the issue!

+7 votes

As of 3.1 you can do this by adding _get_configuration_warning to your GDScript:

tool # must be a tool script to work
extends Node

export(String) var name:String

func _get_configuration_warning():
    if not name:
        return 'Name not set'
    return ''
by (4,005 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.