0 votes

In the Scene view some built in nodes show warnings if a specific child or value is missing. Can you set this up your self from code? And how would you do that if it is possible?

Example of warning

in Engine by (57 points)

2 Answers

+1 vote

I never done it, but it looks like it's possible. See this article:

https://dfaction.net/godot-editor-tips-custom-configuration-warnings/

by (21,656 points)
0 votes

Hi try to use:

func getconfiguration_warning()
return "Text warning" if ...

an example form a tutorial, they need to call a function(by pressing a button) to change the level but the level needs to be uploaded on the variable in the inspector.

func onbuttonup() -> void:
PlayerData.reset()
get
tree().changescene(nextscene_path)

func getconfigurationwarning() -> String:
return "The property Next Level can't be empty" if next
scene_path == "" else ""

the tutorial on divided in 3 parts and is on YouTube, don't remember which one was, hope it helps.

https://www.youtube.com/watch?v=Mc13Z2gboEk&t=327s

by (196 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 Frequently asked questions and 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 [email protected] with your username.