Skip to content

get_node_and_resource docs are confusing #2975

@rcorre

Description

@rcorre

The docs for Node.get_node_and_resource seem contradictory:

If several nested resources are specified in the NodePath, the last one will be fetched.

To me, that says that get_node_and_resource("Area2D/CollisionShape2D:shape:extents") will fetch extents, because that is the "last" of several "nested" resources. However, the docs instead show this:

print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]

So it seems the first resource is fetched, and the remaining resources are just returned as an "extra" nodepath.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:class referenceIssues and PRs about the class reference, which should be addressed on the Godot engine repositoryenhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions