How to snap cursor to TileMap cells?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RedLizard

So i want to make sandbox type game like minecraft in 2d and im trying to snap cursor to tilemap cells.
i tried this but it’s not working:

get_viewport().warp_mouse(tileMap.map_to_world(get_global_mouse_position()))

please help if you can :slight_smile: