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

[3.x] Implement Scene Unique Nodes #60527

Merged
merged 1 commit into from
May 2, 2022

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Apr 26, 2022

Backport of #60298, including changes from #60511
Introduces small compatibility breakage: % is no longer allowed in Node names.

@KoBeWi KoBeWi added this to the 3.5 milestone Apr 26, 2022
@KoBeWi KoBeWi requested review from a team as code owners April 26, 2022 11:40
@KoBeWi KoBeWi force-pushed the unique_names_demastered branch 2 times, most recently from 74c1361 to e1c74ae Compare April 26, 2022 11:55
@Mickeon
Copy link
Contributor

Mickeon commented Apr 26, 2022

Merging this in 3.x would allow more users to try the feature out and possibly address some design issues that may arise before 4.0 goes beta and locks compability-breaking features. I'm all up for that.

@akien-mga akien-mga merged commit 6ee6433 into godotengine:3.x May 2, 2022
@akien-mga
Copy link
Member

Thanks!

@elvisish
Copy link

Scene unique names cannot be used from autorun scripts as they are in a different scene in the tree, is this intentional?

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 19, 2022

$"%Node" is functionally equivalent of owner.find_node("Node"). If your unique node belongs to another scene, you need to fetch the scene first, then node, e.g. $"Scene/%Node" or some_scene.get_node("%Node").

@elvisish
Copy link

$"%Node" is functionally equivalent of owner.find_node("Node"). If your unique node belongs to another scene, you need to fetch the scene first, then node, e.g. $"Scene/%Node" or some_scene.get_node("%Node").

This could be difficult if you're not sure the name of the main scene you're looking for the node in, which slightly defeats the purpose of this I guess? I think for global autorun work, groups are still faster and easier to work with.

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 19, 2022

Well, unique nodes were designed to be used in the same scene. If you want global nodes, groups are indeed better.

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

Successfully merging this pull request may close these issues.

4 participants