+2 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?

asked May 2, 2018 in Engine by Blaise Bernier (22 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.


answered May 2, 2018 by volzhs (9,442 points)
selected May 3, 2018 by Blaise Bernier

I opened the issue!

+4 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 ''
answered Feb 25, 2019 by Dlean Jeans (3,862 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.