Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mydoghasworms | |
Old Version | Published before Godot 3 was released. |
As the question says, how can I get the sprite(s) at a particular location in 2D?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mydoghasworms | |
Old Version | Published before Godot 3 was released. |
As the question says, how can I get the sprite(s) at a particular location in 2D?
Reply From: | eons |
Get all the sprites, iterate over them and check if their get_item_rect
has_point
with your point (rotations may affect the rect a lot).
Could be better if you use sprites for visual representations and areas for detections, the engine and your game may work better that way.
If you are interested on using Areas, look at this getting intersect_point() to work - Archive - Godot Forum