How to Display Tilemap Coordinates at Mouse Position Using Unity's Coordinate Brush

Mar 21, 2024Apr 9, 2025 Updated📖 10 min read | 5,965 charsGame DevelopmentUnity
Unity editor with Coordinate Brush active, showing coordinates at the mouse position

When developing 2D games in Unity, you'll often use Tilemaps to build your maps. While placing tiles and setting up events, there are plenty of moments where you think, "What are the exact coordinates at my mouse cursor right now?"

That's where the "Coordinate Brush" comes in handy. This brush displays the corresponding Tilemap coordinates in real time as you move your mouse over the Tile Palette window.

This article provides a detailed explanation of the Coordinate Brush features, how to install it in current Unity versions (a few things to watch out for!), and basic usage instructions.


What this article covers

  1. What is Coordinate Brush?
  2. Key features and benefits
  3. Installation guide (important: current setup procedure)
    • Note: Current status of the 2D Tilemap Extras package
    • Installing Coordinate Brush itself (from GitHub)
  4. Basic usage of Coordinate Brush
  5. Troubleshooting
  6. Summary: Streamline your coordinate checking workflow

What is Coordinate Brush?

Coordinate Brush is a custom brush for Unity's Tilemap system. It was originally included in the "2D Tilemap Extras" package, an official set of useful extensions provided by Unity.

Its main function is to display the cell coordinates (Tilemap coordinates) in real time when you hover your mouse cursor over a tilemap in the Tile Palette window.

As shown in the image below, coordinates are displayed in (X, Y) format right next to the mouse cursor, making it much easier to precisely place tiles and verify event trigger positions.

Unity editor with Coordinate Brush active, showing coordinates at the mouse position

Key Features and Benefits

The main advantages of using Coordinate Brush include:

  • Real-time coordinate display: Instantly check Tilemap coordinates just by moving your mouse.
  • Precise positioning: Grid-aligned coordinates make precise tile placement effortless.
  • Event and object placement assistance: Quickly find the exact coordinate when you need to place events or objects at specific positions.
  • Faster debugging and level design: Dramatically reduce the time spent on coordinate verification during map editing and debugging.

Installation Guide (Important: Current Setup Procedure)

The installation process for Coordinate Brush differs from what it used to be. The "2D Tilemap Extras" package that previously included this tool has changed, so pay attention to the following.

Note: Current Status of the 2D Tilemap Extras Package

Coordinate Brush was once part of the "2D Tilemap Extras" package. However, according to Unity's official documentation, Coordinate Brush has been removed from the standard feature set since version 3.1.0 of this package. (Currently, only GameObject Brush, Group Brush, Line Brush, Random Brush, etc. are included.)

Reference: 2D Tilemap Extras v3.1.0 Manual

As a result, simply installing the latest "2D Tilemap Extras" from the Package Manager will not give you Coordinate Brush.

Installing Coordinate Brush Itself (From GitHub)

To use Coordinate Brush in a modern Unity environment, you need to import the script file directly from the GitHub repository:

  1. Open the CoordinateBrush.cs file from Unity's official 2d-extras GitHub repository using the link below: GitHub: Unity-Technologies/2d-extras/.../CoordinateBrush.cs
  2. Right-click the "Raw" button on the right side of the page and select "Save link as..." to download the CoordinateBrush.cs file. (Alternatively, copy the entire code and create the file manually.)
  3. Place the downloaded CoordinateBrush.cs file in the Editor folder inside your Unity project's Assets folder. (If no Editor folder exists, create one directly under Assets.)
  4. After placing the file, Unity will automatically compile the script. If it isn't recognized automatically, try restarting the Unity editor.

Coordinate Brush is now installed and ready to use in your project.

Basic Usage of Coordinate Brush

Using Coordinate Brush is very straightforward:

  1. In the Unity editor, go to Window > 2D > Tile Palette to open the Tile Palette window.
  2. Click the brush selection dropdown at the top of the Tile Palette window (where the default brush icon is displayed).
  3. You should see "Coordinate Brush" in the brush list — select it.
  4. Move your mouse cursor to the Scene view where a Tilemap exists.
  5. The Tilemap cell coordinates will now be displayed in real time following your mouse cursor.

You can now easily identify the coordinates of any position where you want to place tiles or check locations.

Troubleshooting

If Coordinate Brush isn't working properly, here are some potential causes and solutions:

  • Coordinate Brush doesn't appear in the brush list:
    • Verify that the CoordinateBrush.cs file is correctly placed in an Editor folder within your project.
    • Try restarting the Unity editor after placing the file.
  • Coordinates don't display after selecting the brush / errors appear:
    • Check the Unity editor's Console window for compile errors in the CoordinateBrush.cs script. (The file may not have been downloaded or copied correctly from GitHub.)
    • While rare, there's a small chance of version incompatibility, though the script generally works with relatively recent Unity versions.
  • Confusion with older 2D-Extras package: If you previously installed an older version of 2D Tilemap Extras from the Package Manager, unexpected conflicts might occur. If unnecessary, remove the old package and consolidate to the GitHub-sourced script approach.

Summary: Streamline Your Coordinate Checking Workflow

Coordinate Brush is an incredibly useful editor extension tool for 2D game development with Unity's Tilemap, letting you check map coordinates in real time.

While it's no longer included in Unity's standard packages, it can still be used in modern Unity environments by importing the script file from GitHub.

It improves development efficiency in various scenarios — from level design requiring precise tile placement, to setting events at specific coordinates, to checking object positions during debugging. Setup is simple, so if you're working with Tilemaps, give it a try.

Share this article