Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve integration of tool Nodes and AutoLoad singleton objects #10611

Closed
drtwisted opened this issue Aug 24, 2017 · 2 comments
Closed

Improve integration of tool Nodes and AutoLoad singleton objects #10611

drtwisted opened this issue Aug 24, 2017 · 2 comments
Labels

Comments

@drtwisted
Copy link

  1. Create scene
  2. Add a Node
  3. Add a simple tool script to it
tool
extends Node

export(Texture) var player_sprite
export(int) var health_points
  1. The exported vars are visible in the Inspector
  2. Create unattached script global_singleton:
extends Object

func some_global_method():
    print('Called global method')
  1. Add it to AutoLoad scripts in Project Settings
  2. Append next code to your Node script:
func some_method_using_singleton():
    global_singleton.some_global_method()

Actual result:
The exported vars are gone from the editor and the Node is in fact no longer a tool

Expected:
The Node tool mode persists

@Zireael07
Copy link
Contributor

Is that on master?

@27thLiz
Copy link
Contributor

27thLiz commented Aug 24, 2017

The exported vars are gone from the editor and the Node is in fact no longer a tool

That's because the script fails compiling, since autoloads can't be used in tool scripts yet.
Closing as duplicate of #4236.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants