Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | FlavoredCactus | |
Old Version | Published before Godot 3 was released. |
So i noticed using world_to_map() on the position of a node will give me the position of that node on a tile map but i can’t seem to figure out a way to efficiently get a list of nodes within a neighboring tile.
I made a work around using groups and comparing the world_to_map location of every node in that group:
https://gist.github.com/FlavoredCactus/10c45f2caf0e17efefd037783e00438b
There must be a simpler way or something i’m missing. any thoughts?
Keep it mind tiles are not nodes at all. Do you need to get neighboring tiles, or nodes that are on these neighboring nodes?
Zylann | 2016-08-20 23:53
I need the nodes that exist in that neighboring tile. I’m aware tiles are not nodes at all. I’m using them as a form of measurement.
say a node is at 5,5 and needs to know if a node is at 5,6 before moving spaces.
FlavoredCactus | 2016-08-21 00:23