Is it a bad habit to require a certain child on an instance by using the @tool annotation?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Marco-

In my project I have some guards that are supposed to patrol a certain path.
In their script they load the PatrolPath node that is supposed to hold multiple or none Marker2Ds as children.

The guard scene itself does not hold the PatrolPath because I want to manually add that one to every instance of the guard. Because I reference the node in the script I want to make sure the developer can clearly see why there is a problem when a guard does not have that extra PatrolPath node. I want to show that by displaying a warning in the editor by using the @tool mode and by using the _get_configuration_warnings function.

Now I am wondering whether that is a bad habit and I should do this another way because the whole logic for my guard is also in that script that is a tool script now.

I hope it’s clear what I mean and thank you in advance Godot Community

:bust_in_silhouette: Reply From: zhyrin

If a value should be set at design time (editor), then it’s perfectly valid to show a warning.