Replies: 1 comment 1 reply
-
This feature already exists: drag the script with CTRL and it will make a child Node with the script attached (if the script extends a Node type or derived). You are confirming once more that it is a hard to discover feature. I did the same once before: #7211 |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
The problem
When creating composition-oriented elements in the editor, let's say logic bricks that you'd like to use to compose items, you have to create a gdscript and a packed scene in order ot be able to use drag and drop to compose the elements, taking this structure as example (where each node also updates its name to make it easier to read the effect of the item):

Current approach
At the moment, each
Node
of the screenshot shown above is just aNode
with a gdscript attached to it. Creating these nodes can be made using the "right click => 'Add Child Node' => pick 'Node' => attach desired behavior script to it" approach.This means 4 steps to add my script to a new node, becoming a bit much when more complex behaviors are going to be composed with more logic components.
To make this easier to compose, I created a
.tscn
file for each component that can be used in this context, each.tscn
being just aNode
with the component's script attached to it.Proposal
As I believe composition is a core concept of the engine (and a quite powerful one in videogames design overall), I think it's make sense to add a way to create a node on the fly when dropping a script.
My current idea would be to allow this through a modifier keypress (like Ctrl, Alt or Shift) while the drop is being made, Editor would then create a node using the type that the script extends as base type and attach the script to it.
Beta Was this translation helpful? Give feedback.
All reactions