Topic was automatically imported from the old Question2Answer platform.
Asked By
abelgutierrez99
Hello, I’m new to Godot,
I was wondering is there is a way to check is at some point there is a node at some position (node.translation == position). I can do this storing all nodes in an Array and make an if statement, but this might be inefficient. (I’m making a 3d game)
You would use Areas for that. They can tell you what is inside their bounds, but have two caveats :
They can only detect other collision based objects (other Areas, your player, etc)
They only update the information once a tic, during physics. You may want ot run your code under some _physics_process(), or use a yield(get_tree, “physics_frame”)
But what I want to check while some code is executed, for example: a random walk that create tiles and I want to avoid two tiles at the same point?