set_cell() is not putting any tiles when the game is running


Now the remote scene tree looks like this, but the tiles are still not being displayed.

You’ll need to provide more context. You have scripts attached to 3 nodes. Post those 3 scripts in their entirety.

game node script:

map node script:

TileMapLayer node script:

What’s the purpose of doing var script = preload(...).new()?

Was trying to figure out how to call functions from other scripts. Looked it up and found the preload line. Honestly I just need to be able to call functions from other scripts, so if there’s a better way to do that it might fix it maybe.

Oh, that’s not the way to do it. To call a function in another script you need to get a reference to the node the script is attached to and then just call it using the dot syntax.

So to call createShape() in a tile map script from the map script:

$TileMapLayer.createShape(...)

or

get_node("TileMapLayer").createShape(...)
1 Like

It worked! You are actually a lifesaver! I’ve had this problem for like, 2 days… Thank you so much!

1 Like