Godot: Ability to drag a gd script into the scene

Created on 19 Feb 2018  路  10Comments  路  Source: godotengine/godot

And if the script is valid, and extends at least a Node, this would create the base class of the script, and attach the script to it.

archived feature proposal editor usability

Most helpful comment

I wonder if GDScript icons should have a small icon of the node they extend too, then this will make more sense as optional workflow.

All 10 comments

I don't think this suggestion is useful because that isn't how Godot's workflow work.

In Godot you create a scene with as many nodes as you want, attach a script to the nodes and instance that scene into another scene. The times you will create a script that extends Node without following that is pretty much 0.

http://docs.godotengine.org/en/latest/getting_started/step_by_step/instancing.html

you create a scene with as many nodes as you want, attach a script to the nodes

You described the content of my suggestion. The only difference is single drag and drop instead of add new node, find proper node type, drag the script onto the new node.

It makes sense as gd scripts mention extending a given node

I wonder if GDScript icons should have a small icon of the node they extend too, then this will make more sense as optional workflow.

That would probably work for GDScripts that extend a node type, just be careful to check that, because a script can also extend any other object type, or even just nothing (helpers or vanilla classes for example)

I agree that could be useful, especially for homegrown Entity-Component systems.
Also, I tried to drag a script in this way a few times already, hoping it would work 馃槂

Since there's no 1:1 mapping between scenes and scripts, is this even possible? (A script can be attached to multiple scenes.)

@Calinou It's only possible for scripts that extend Node or derivatives I guess. If a user attempts to drag in something that extends a Resource for example it should display an error popup or something similar.

Is this still relevant now with class names? these allow to add nodes with the node selector which is a better workflow.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings