Godot Version
4.2
Question
how to make my area2d position snap to tile size and follow mouse position at same time?
i want my area2d follow my mouse and my cursor more or less in middle of my area2d.
it working if my area2d size like 32, 96 , but if size lie 64,128 it wont snap anymore.
my tile size 32x32
this my code
func cursor_pos() -> void :
var new_pos : Vector2 = tile_map.map_to_local( tile_map.local_to_map( get_global_mouse_position() ))
cursorAreaBase.global_position = new_pos