Search Unity

Rotating Tile 45 degrees

Discussion in '2D' started by MousePods, May 2, 2019.

  1. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Hi!

    I have a quick question I cannot seem to figure out.

    I want to rotate my tile on the tilemap by 45 degree increments. Is there a setting to allow this? If not, is there a direction I can be pointed to to implement this myself?

    Thanks!
     
  2. MegamaDev

    MegamaDev

    Joined:
    Jul 17, 2017
    Posts:
    77
    This isn't a feature by default. To implement it, there are two things you need to know:
    1. How to access and modify a tile's transform matrix (probably from a component at first, just for learning)
    2. How to write a custom GridBrush with which to do the above in-Editor
    Once you've got those, you've basically got everything you need (apart from fixes for any culling issues you may hit--feel free to ask for help regarding that also).
     
  3. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Thanks for the information!