Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

If you haven't found the answer for clickable buttons yet, here's a snippet from my game - in Update() you want to check for the mouse click, then get the position of the mouse. Last line converts it to a tilemap position if you're using tilemaps.

if (Input.GetMouseButtonDown(0)) {    
Vector3 clickWorldPosition = _mainCamera.ScreenToWorldPoint(Input.mousePosition);    
Vector3Int clickCellPosition = _shipTilemap.WorldToCell(clickWorldPosition);