Allow configuration of nodes in the inspector through configuration/intialization script #7077
thornySoap
started this conversation in
Editor
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not quite sure whether the "Scripting" topic would suit better, but here is what I thought about:
The/One purpose of the inspector is to have a "centralized" place for configuration of nodes, isn't it? In scripts you define behavior, in the inspector you configure. So you aren't forced to create a separate script for every single node in the scene tree and do configuration in the
_ready()
function.But what if configuration goes through a method for example? Then you either have to create a single script for that, resulting in single-case scripts in the file system that aren't related to a scene (I like to always have pairs of
name.gd
andname.tscn
for single-case objects, so I can see directly where the script is attached to), or the configuration goes through the_ready()
-method of the scene tree root, making it really hard to track where configurations are made.Wouldn't it be nice then to be able to attach a small block of code to a node beeing treated as part of the
_ready()
-function directly in the inspector? I would suggest for example putting an new inconspicuos category "Custom Configuration Script" between "Script" and "Metadata" in theNode
's inspector, expanded showing a text box.This would overall act similar to creating an object in Kotlin, while
apply
ing a code block beeing executed within the object's scope.Since I just found out one can bind arguments when connecting a signal via the inspector, I personally wouldn't need this so urgently anymore, but maybe still something to think about?
Beta Was this translation helpful? Give feedback.
All reactions