Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Feature Request] Shortcut keys and other tools for working with tilemap

Discussion in '2D Experimental Preview' started by mgear, Jun 3, 2016.

  1. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Needs shortcut keys to quickly work with tilemap painting..

    Maybe something like commonly in pixel art editors,
    and if they are conflicting with main unity keys, [x] override keys in tilemap mode as an option?

    - Right click to erase (or pipette, can pick tile from scene window tilemap layer) *since right click and middle mouse button both are panning now
    - (E)rase, (B)rush, (F)ill, (I)Pipette/eye dropper
    - Shortcut keys for selecting next-prev tile in tilemap palette (without going there with mouse)
    - Maybe even quick select slot assign (ctrl+1 = assign this tile into key #1), so can quickly swap between most common tiles
    - Selection box (so that can copy & paste selection from tilemap, for example parts of the level can be then re-used easily)

    *probably some of those could be done with editor scripts..but still.
     
  2. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Right now the hotkeys for painting are SHIFT for erase and CTRL for picking.
     
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    "Shortcut keys for selecting next-prev tile in tilemap palette"
    This is very important for me too
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Ok that works, still missing cursor change though (to show which tool is activated when pressing shift or ctrl)

    Just founded the X, Y, comma, period for flip/rotate..those are useful,
    and selection box seems to be already there (hold down ctrl and drag select area)
     
  5. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    Apologies for forgetting to add the shortcut keys in the reference guide. Happens in a rush ;)
    Just added them but for anyone who hasn't checked out the reference guide and reading this thread:

    Tile Map Shortcut Keys
    Shift + Left-Click = Erase Tiles
    Ctrl + Left-Click = Select Tiles
    Alt + Left-Click = Pan Scene View

    Following keys only work if focus is on the Scene View. So if you just selected a tile from the palette, Right-Click in the Scene View to get focus first.

    Y = Flip selected tile Up or Down
    X = Flip selected tile Left or Right
    . (Period) = Rotate Clockwise
    , (Comma) = Rotate Anti-Clockwise
     
    avictorsa likes this.
  6. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    But you do bring up some good suggestions though.Thanks.. Currently the cursor doesn't change but the icon on the palette is selected though. Is not very obvious though.
     
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Other tools that would be useful:
    - Set tilemap layer (max) size (if want to make level with grid of 64x64, have to manually calculate tiles?)

    - Show coordinates in which tile (X,Y) your mouse is in the current layer (if want to place certain object at same height in large layer, would be easier to do if know the coordinate)
     
    spacehelmetboy and jc-drile77 like this.
  8. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    - Using keyboard (arrowkeys) to scroll/pan Palette window if its active, even zoom/in out with keyboard + - could be nice

    - Difficult to see which tile in palette is selected (thin white outline not really visible, especially it tile has some white also)

    - Flipping tile that has pivot at Bottom Left, makes the tile go "outside" current tilemap cell (since its flipped from the Bottom left.. probably more useful if it would still flip from center, so can use it in that cell where the cursor is..)
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Oh'noes.. I had scene window maximized while painting tiles,
    then somehow wrong layer was active, drew half of the background to main layer.. Oo
    (With coordinates and active layer name display maybe it would had not happened.. : )

    or maybe tilemap layer locks?
    upload_2016-6-9_18-19-51.png

    also,
    If tilemap layer gameobject is disabled, you can still modify it, like erase (if its selected in hierarchy)
     
    Last edited: Jun 9, 2016
    spacehelmetboy and der_r like this.
  10. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    Locking tilemaps would be pretty neat.

    I'd throw in a dropdown list with all possible tilemap layers in the scene, so you don't have to search through and click on them in the hierarchy view. Gets cumbersome as the scene fills up with other gameobjects and if you have multiple tilemaps with their own layers.
     
    spacehelmetboy likes this.
  11. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    Any sort of layer system like photoshop has would be great
     
  12. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Is there a way to clear tilemap?


    **Ok, doing Reset on the TileMap component works
     
  13. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    How about if in scene window could have "zoom to actual size" button or shortcut key?
    like in photoshop you can zoom to 100%.. (actual size being the pixel perfect size)

    Also Pressing F takes you always too far (with all objects in unity),
    and if you press F two times while tilemap layer is selected, it just pans to the pivot..
    pressing F twice with tilemap could have some other use..(like zoom between actual size, zoom to frame object)
     
  14. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Cannot clone (eyedropper pick) empty tile,
    it would be nice to just get the null tile selected as brush (when pressing ctrl), so can use it as an eraser..
     
  15. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    807
    I second the selection box idea of being able to cut/copy and paste a selection.

    It would be extremely useful especially when building giant levels. Currently I would use it to move independent sections around, testing them in various parts of the level.
     
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    copy paste is a basic requirement in any editing software
     
    sLakke likes this.
  17. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    using selection box (with ctrl pressed) works quite fine as copy-paste, can make big selections too.
    and i think could erase with that big selection by pressing shift, so its almost like cut..
     
  18. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    Yes you can, thats a typical workflow for me, ctrl-drag to select then shift click to erase as a Cut.
     
  19. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    What's the hotkey to activate Brush mode while you're currently moving game objects around in the scene then want to repaint tiles?
     
    spacehelmetboy likes this.
  20. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    Currently working on implementing hotkeys.
     
    spacehelmetboy likes this.
  21. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    Yes, need a shortcut keys for TileMap editing tools - I'm suggesting that it works like a toggle. Because if I am in Edit mode and I want to quickly select another TileMap.
    - Select TileMap in Scene View
    - Select Tile in Tile Palette
    - Hit 'B' key (On)
    - Paint tiles
    - Hit 'B' key (Off)
    - Select another TileMap in Scene View
    - Hit 'B' key (On)
    - Paint tiles
    - Repeat

    A quick way to get in and out of editing mode, instead of another key for that.
     
    spacehelmetboy likes this.
  22. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    Yes, this is what I am looking for. Maybe change the cursor so that its super clear brush mode is preventing me from selecting other objects :)
     
  23. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Still hoping to get custom mouse tool cursors when tilemap editing modes are enabled..

    Just clicked scene view 20 times trying to pick one object,
    only to find out that I had brush mode enabled (but no tilemap selected) so couldn't pick any objects..
    (mouse cursor is the default one, so didn't see any difference)

    Or if tilemap is not selected in hierarchy, but brush mode is enabled,
    maybe it should allow picking objects normally..since you cannot paint either.
     
  24. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    How do you edit/delete or reorganise the palette?
     
  25. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,324
    Clicking the small Lock in the palette window makes it editable/locked,
    then you can use those eraser/drawing tools there
     
  26. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
  27. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    How do you add a prefab to the palette window?
     
    Last edited: Sep 12, 2016
  28. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    @mgear yes its currently a bit funky. Thinking of a Select mode and cursor while Tilemap is selected as well. We're making some design changes and also fixing alot of the ux. This will be in the next release.

    @Ryan-Hayle Only tile assets are added to the palette. Prefabs need to be associated to a tile asset.
     
  29. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    I have a prefab with a sprite and I add this to the gameobject of the tile asset. Nothing is displayed in the palette window.
     
  30. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    Currently the prefab is not displayed in the palette, only the tile asset.
     
  31. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    Hi Joh,
    I have asked the same question 3 times and your reply still does not make sense to me?

    Back in July I said:
    Is there any reason why you can't paint prefabs with the preview tilemap editor?

    You reply:
    Prefabs need to be attached to the tile asset.

    What I have tried:
    1. I tried to drag a prefab straight into the palette, previously errored, now nothing happens.
    Fair enough, but it would be nice to drag prefabs in like sprites.

    2. I have created a tile asset, attach the prefab to the gameobject and drag it into the palette. Nothing happens.

    3. I have created a tile asset, attach the prefab to the gameobject and use another image in the sprite propertry. I drag this to the palette and can see something in the palette. I am able to paint, but with strange results.

    4. I remove the sprite from the tile asset (back to just a gameobject) and it disappears from the palette again.

    Does the tile asset not work correctly or am I missing a step, as I can not see another way based on what you have said?

    Thanks
     
  32. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    Ryan-Hayle, it does work. Create a standard tile asset and change the "object" slot to point to the prefab.
     
  33. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    @Ryan-Hayle Apologies for my unclear replies. Number 3 in your list is correct. Could you create a new thread on this and elaborate on the "strange results".
     
    spacehelmetboy likes this.
  34. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    Previously I would use a 3rd party tile editor and drag the prefabs (containing sprites, colliders, animations, scripts, etc) into a palette and paint with them and so taking the same approach I have automatically attached my prefab to the tile asset gameObject. In order to get it to work I added another sprite to the tile asset sprite property. I realise it is not intended to work this way and if you do attempt this, you get an out of alignment gameobject.
     
  35. Slapworth

    Slapworth

    Joined:
    Aug 11, 2013
    Posts:
    19
    Hi Johaness_Reuben -

    Do these hotkeys work for hexagon tilemaps? I'm trying to rotate tiles in a new hexagonal tilemap and they're not working.

    Thanks - ChrisF