scenes/player/cursor.gd there is a concept of interactable objects. These are objects on the map that the player can interact with using their cursor.
When the player clicks the cursor
Cursor and begins to process all of the objects returned by it.
In order for an object to qualify as an interactable under the cursor the following conditions must be true:
Interactable.map_positionmust be less than or equal to
Additionally one of the following must be true:
CollisionShape2Dthat is overlapping with the Cursor
map_positionequal to the
map_positionof the Cursor
Please note the use of
position in the setter and getter for
extends Node export (int) var interact_range: int = 1 var map_position: Vector2 setget _set_map_position, _get_map_position func interact(): pass func _set_map_position(new_position: Vector2): global_position = Services.MapManager.map_to_world(new_position) func _get_map_position() -> Vector2: return Services.MapManager.world_to_map(global_position)