Skip to content

Engine.GetSingleton() fails to resolve auto loaded nodes in C# #15397

Open
@mysticfall

Description

Godot version:
master / 0e6e98a

OS/device including version:
Manjaro Linux 17.1-rc2

Issue description:
If I have an auto loaded node named RootContext, running the following code fails to resolve the node instance with an error, "Failed to retrieve non-existent singleton 'RootContext'":

var context = Engine.GetSingleton("RootContext");

However, the following code correctly resolves and retrieves the node correctly in the same settings (invoked inside another Node instance):

var context = GetNode("/root/RootContext");

I'm not entirely sure if it's the correct way to resolve singletons in C# though.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions