Search Unity

Resolved How to find if gameObject is a tilemap?

Discussion in '2D' started by Magnesium, Apr 3, 2021.

  1. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    179
    Hello,

    I'm writing a script that needs to know if it is applied to a tilemap object or not. It seemed trivial to me at first but i can't find to do it. What would be the right approach?

    Thanks
     
  2. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    179
    Ok got it, just had to add the UnityEngine.Tilemaps namespace to be able to fetch the specific tilemap components.

    Keeping the thread for people running into the same issue.