hey there, as you can see above i want to access a childnode (Tilemap) through my node2D parent object.
did i declare the variable wrong or why wont it show the methods of the tilemap class?

im really new to programming and godot so i appreciate help for a noob 🙂

  • The variable has a dynamic type, so it can't autocomplete the methods,
    you have to use a typed variable instead

    @onready var tilemap : TileMap = $TileMap

    this is currently broken when the initial value inherits Node and makes the variable's type Node instead,
    so you actually have to use an inferred type with a cast.

    @onready var tilemap := $TileMap as TileMap

    more information here.
    (that page is slightly outdated, static typing already improves performance in 4.0)

gorger changed the title to Access Childnode (tilemap) .

The variable has a dynamic type, so it can't autocomplete the methods,
you have to use a typed variable instead

@onready var tilemap : TileMap = $TileMap

this is currently broken when the initial value inherits Node and makes the variable's type Node instead,
so you actually have to use an inferred type with a cast.

@onready var tilemap := $TileMap as TileMap

more information here.
(that page is slightly outdated, static typing already improves performance in 4.0)