How to export a TileMap node!!

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By xDGameStudios

Right now I’m trying to export a variable to link to a TileMap node in the scene, so I’m using an:

export(NodePath) var tilemap_node

this exports a variable that lets me select a Node from the scene, and this all works ok.
My problem is when I try to do something as:

var a = tilemap_node as TileMap;

I thought this would work but I get an error!!

“Can’t convert a non-object value to an object type”

I don’t know what this means and how can I make it work!!

:bust_in_silhouette: Reply From: xDGameStudios

Ohhh I think I found the answer!!

The NodePath export must be used with the function get_node(NodePath) to get the corresponding node! Now it works fine!