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

Exported nodes aren't available / set in [Tool] scripts #76182

Closed
timshannon opened this issue Apr 17, 2023 · 5 comments
Closed

Exported nodes aren't available / set in [Tool] scripts #76182

timshannon opened this issue Apr 17, 2023 · 5 comments

Comments

@timshannon
Copy link

Godot version

v4.0.2.stable.mono.official [7a0977c]

System information

Ubuntu 22.10

Issue description

Exported nodes don't seem to be set before a script marked as [Tool] is run in the editor.

Steps to reproduce

Either use the attached project or do the following:

  1. Create a new scene, and attach a new C# script to the root node
using Godot;
using System;

[Tool]
public partial class main : Node3D
{
    [Export]
    public Node3D NodeTest;

    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(double delta)
    {
        GD.Print(NodeTest.Name);
    }
}
  1. Build the solution, and associate any node to that exported variable.

Even though it's set, the node isn't accessible from within the editor.

Minimal reproduction project

bug.zip

@Calinou
Copy link
Member

Calinou commented Apr 17, 2023

@timshannon
Copy link
Author

Confirmed, yes, it happens with GDScript as well:

image

@timshannon timshannon changed the title Exported nodes aren't available / set in [Tool] scripts (for c# at least) Exported nodes aren't available / set in [Tool] scripts Apr 17, 2023
@KoBeWi
Copy link
Member

KoBeWi commented Apr 17, 2023

Duplicate of #74141, unless other types are also affected?

@raulsntos
Copy link
Member

  • This seems like it was fixed by Fix typed array export #76389. The PR is included in Godot 4.1.
  • Can you still reproduce this issue in Godot 4.1 or any later release?

@timshannon
Copy link
Author

@raulsntos confirmed working great now in 4.1.

Thanks,

@KoBeWi KoBeWi closed this as completed Jul 28, 2023
@KoBeWi KoBeWi added this to the 4.1 milestone Jul 28, 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

4 participants