I'm messing around with a 2d style platformer and I want to add collectibles next. Rather than creating a simple collectibles scene and then instancing/duplicating it over and over, I figured it may be more efficient to create a tile map with just that one tile attached to it, but I don't know If this is a plausible option. This brings me back to my main question, can it be done? And more importantly, how can it be done?

p.s. I'm sorry if this all sounds vague, but I'm still fairly new to game design and when I explained this to rubber duck sensei, I was only answered with more questions.

p.s.s. That said, if you need me to elaborate more, I will do my best to do so.

Yes, it's possible to attach a script to the Tilemap Node, though I could not find any examples. I did find this question about interacting with Tilemaps from the forums, and sleepprogger has some example code that may be helpful. The code he posted would be used from the player's node, but in theory it would not be too hard to make it work from the Tilemap, you'd just need to get the player's position and then run the calculations from there.

Though depending on how many collectibles you plan on having in one scene, it may just be easier to instance scenes instead. It would be a bit more time consuming (and would look uglier in the editor... I know from experience :) ) but it has the advantage of being easier to work with and as long as you don't plan to have hundreds of collectibles at a time, the performance hit should be minimal.

Incredibly helpful! Thank you. Ultimately, I've decided to go with the instancing method. It just works better with the signals and mechanics I am fiddling with. Thanks for all the help!

5 years later