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

Can't assign exported array of nodes #71603

Closed
Badaxis opened this issue Jan 18, 2023 · 4 comments
Closed

Can't assign exported array of nodes #71603

Badaxis opened this issue Jan 18, 2023 · 4 comments

Comments

@Badaxis
Copy link

Badaxis commented Jan 18, 2023

Godot version

v4.0.beta12.official [3c9bf4b], v4.0.beta13.official [caacade]

System information

Windows 10

Issue description

There seems to be an issue with typed array of nodes, assign in the inspector doesn't work.
For example I used:

@export var arr_node: Array[Node3D]

In the inspector I have the contextual menu to assign a node from the tree but when I select it, it's not assigned.

These work properly with the same contextual menu to assign:

@export var node: Node3D
@export var arr_path: Array[NodePath]

Steps to reproduce

  1. Create a basic scene with a script
  2. Export an Array[Node3D] or other node type
  3. In the inspector, try to assign a node from the tree into the array

Minimal reproduction project

array_node.zip

@Gnumaru
Copy link
Contributor

Gnumaru commented Jan 21, 2023

This also happens on beta 14. I haven't tested in earlier betas.

A nodepath array export is persisted differently than a node export or node array export, if I'm not mistaken. A nodepath value can be serialized and unserialized directly in the .tscn, but in the case of node exports I think there is some metadata juggling in order to make it work. I haven't looked the code but I think it should be something like serializing an array of nulls but, in the metadata, holding an array of nodepaths, and after unserializing, after the whole tree has been set up and every node exists in its expected path, then the metadata is used to get the nodes and fill the array.

@andersonmadeira
Copy link

Also saw this on beta 16.

@dark-elf1
Copy link

Still present on v4.0.beta.custom_build [d01ac9c] on linux.

@raulsntos
Copy link
Member

Duplicate of #62916

@raulsntos raulsntos marked this as a duplicate of #62916 Jan 29, 2023
@raulsntos raulsntos closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants