Search Unity

Question Tile Palette not Painting

Discussion in '2D' started by SaltChaos, Sep 3, 2022.

  1. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    Hi there, I'm a complete newbie with Unity and just trying to get a Tilemap and a Tile Palette working. I've follow a tutorial, (that maybe a little old, but 2020 version should'nt be that old) https://docs.unity3d.com/Manual/Tilemap-workflow.html is the said "tutorial".
    My problem is I cannot paint with the Tile Palette on the Tilemap, and I've seen the problem is recurrent, with multiples solutions :
    Sometimes missing the Tilemap : I've got it, for sure in the Hierarchy tab, with the Grid.
    Sometimes the Tilemap if created before the Tile Palette, the Painting wasn't working, that was my case, and so recreated it. Still got the problem.
    Sometimes the Active Tilemap is absent or not set : It's set on the only Tilemap I've got named basically "Tilemap".
    Sometimes the Edit button making it bugged and so you needed to reselection it and deselect it to get it work, tried, and that didn't resolved the issue.

    So I've got no idea about why this is happening, since I'm a newbie, and maybe that a really dumb issue that I've failed to check correctly something. But it seems I cannot find it alone.

    Some screen of the default screen : upload_2022-9-3_19-46-18.png
    The Tile Palette (pretty ugly that a placeholder lol) :
    upload_2022-9-3_19-47-59.png
    And the Tilemap properties :
    upload_2022-9-3_19-50-5.png

    If any more screen are needed to understand the issue, I guess I can provide them, so tell me.
    And thanks in advance to everyone that'll will help (or try so)
     
  2. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Hello, its hard to tell what the issue is just from your screenshots
    If you select a tile in the palette and hover your mouse over the scene tilemap, does the tile preview show up?
    If it does, when clicking in the tilemap scene to paint, does the tile appear?
    Alternatively, you can look for more info for Painting on Tilemaps in our documentation page

    If your problem is still not resolved and you believe its a bug, do use Unity's internal bug reporter and attach your project for us to take a look, thanks.
     

    Attached Files:

  3. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    Wait wdym by the tile preview show up ? Is that supposed to highlight the grid tile border in yellow ? Or is that litteraly supposed to show the selected tile on the grid + the yellow border ? Cuz if that the last, it definitely does not, then I understand than yeah it was probably hard to understand with just the screen I've provided.

    After reading a little the doc it seems yeah it supposed to be previewing the selected tile on the grid, so yeah it doesn't preview at all. Well I was pretty sure I've read it all multiple time without missing anything, but even with knowing that, and sadly doesn't help that much.

    Tbh I don't know if this a bug or not, cuz this might be just me not doing it right. If I happens to learn it's one, then I'll report it, but no idea why this would happens to only me - unless they're others people with similar problem, but I doubt it since it look like a heavy issue to not be able to use a tool at all.
     
  4. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Hey @SaltChaos , it seems like you've got everything set up correctly.

    Tile Palette: Tiles are populated fine and you have also selected the Brush tool and it's set to the Default Brush so it's all good. It looks like you've also selected a middle green Tile so that's good too.

    Tilemap: Looks fine to me too. The Grid type looks like it's Rectangle which is the same as your Tile Palette Grid and it's also been set as the current Active Tilemap (as seen in your Tile Palette window).

    You should be all set up for painting. This is interesting.

    I was wondering if it's related to the Pixels Per Unit (PPU) of your Tile sheet/Sprite Sheet? It's set to 100 by default. And depending on the size of your individual Tile (mine is 16x16), so I've set the PPU to 16 in the Texture Importer Inspector.

    Pixels Per Unit.png

    I was wondering if your PPU was still set at 100 which is perhaps why the Tiles look like they are not appearing since they may be too small to be visible?
    PPU Incorrect.png

    So after setting my PPU to 16, the Tiles now render correctly.
    PPU Correct.png
     
  5. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    Hey,
    Well I've seen this issue multiple time while researching for a solution to my problem, and actually played with the value a lot, to be sure it wasn't that, and while the value is correct (my tiles are 32px) they still doesn't show. While I put it back at 100 and zoomed a lot to see if they were minimoys, they weren't they're. I don't know if putting it on a value smaller does them make a look bigger ? Well I've tried, and still no sign of any of them, either preview or after.

    upload_2022-9-23_17-23-46.png
    Here the screen showing it.
    Thanks for your answer btw.
     
  6. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, this looks like a strange issue. Could you share what the Grid GameObject looks like in the inspector?

    Also, if you drop in the Placeholder Tile Palette prefab into your scene, does all the Tiles in Placeholder show up in the Scene?
     
  7. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    Hi,
    To answer your first question, here the Grid GameObject :
    upload_2022-9-26_17-48-27.png

    And for you second question yeah, when I drop the Tile Palette Prefab it does drop the entire palette onto the Scene (no missing tile)
    upload_2022-9-26_17-48-1.png
     
  8. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks for checking! If Placeholder is able to render, then it is likely not a rendering issue.

    Could you try a few more things:
    • Use the Select tool (The Arrow in the Tile Palette) and select a Tile on:
      • Placeholder in the SceneView when it is the target
      • Tile Palette.
      • Does any details about the Tile Selection show up on the Inspector window for both cases?
    • Use the Pick tool (The Eyedropper in the Tile Palette) and pick a Tile in the Tile Palette. Try painting or hover the mouse on the following paint targets:
      • Placeholder in the SceneView when it is the target
      • Your Tilemap in the SceneView when it is the target
      • The Tile Palette with the Edit toggle turned on
      • Does anything change when you do so?
    Hope this will shed more details on this issue!
     
  9. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    No problem, in fact thanks you for taking time to help me lol.

    Well it seems I didn't understand well the part "Placeholder in the SceneView when it is the target".
    Or either I've understood, and you basically need the target on the Tile Palette window like this
    upload_2022-9-27_17-41-16.png
    But as you can see it doesn't appear. Even if I put it somehow as a Child to the Grid Object, if that were ever able to resolve the issue.

    So for the Select tool with the Tile Palette
    For this one I moved it to see both Inspector and the Tile Palette
    And it seems selected, I don't know if the Inspector supposed to give more information.
    upload_2022-9-27_17-28-26.png

    For the Pick & Paints Tools :
    My Tilemap in the SceneView when it is the target
    It doesn't preview neither paint. By the way, I don't know if they're a way to see the pick tile, apart from the Tile Palette I mean.

    The Tile Palette with the Edit toggle turned on
    Still doesn't preview neither paint. An asterix appeared on the Edit button, but I guess that means unsaved changes. Likely to happens.
    I thought I could provide screens for thoses two last, until I realize they wouldn't be different screen from the starting ones.
     
  10. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    This is disturbing. If it is possible, we would like to have this project to investigate further. Would it be possible to send it to us by using the Unity Bug Reporter and post the case number here (Help > Report a Bug)?

    Thanks for your help!
     
  11. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    Ow, considering it's a bug ? Surprising at least.
    Well the case number is : CASE IN-18076
    Didn't think I would end up on a bug within my firsts uses of Unity.
     
  12. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thank you!

    My guess is that the Tiles in the Tile Palette are offset in some way. Having the Tile Palette would be helpful to determine the issue and possibly how it got into that state.
     
  13. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    What do you mean by having the Tile Palette ? The original file ? Don't you have it with the project with the bug report ?

    Well would be strange that they are offset since I've paid attention for them to no be but well.
    Anyway have the file, if I understood correctly lul
     

    Attached Files:

  14. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, I checked out the project. The main issue is that there are no Tiles in the Placeholder Tile Palette (or even a Tilemap component). The Sprites you see are made up of SpriteRenderer GameObjects.

    In order to be able to make use of the Placeholder Tile Palette, you will need to switch from the Default Brush to the GameObject Brush in the Brushes Dropdown.

    If you would like to use Tiles instead, you could create a new Tile Palette following the instructions from https://docs.unity3d.com/Manual/Tilemap-Palette.html .

    Hope this helps!
     
  15. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    Hi, well I was about to say that exactly what I done with the tutorial, so I thought that wouldn't solve the problem.
    I've tried with the GameObject Brushe and it worked, but that would been best if they were tiles so I wanted to make it work.

    But the fact you said there is no Tilemap in the Tile Palette was the been compelling and so I just created a new Tile Palette as the one before, and... tried to paint with this new one, and realized... There a Tilemap created within in, that I probably deleted on the first Palette, thinking this was useless ? Well now that I understood I guess that fixed.

    TL;DR for thoses who have the same issue and don't want to read the whole thread :
    Don't delete the Tilemap created in your Tile Palette, else it never gonna work. Lol. (I feel really dumb now)

    Thanks everyone for your time and help, especially ChuanXin.
     
  16. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    That's great to hear!

    It's really interesting that you were already playing with the GameObject Brush. The GameObject Brush works because it picks up the GameObjects in your Tile Palette and allows you to paint with them. These GameObjects that you have added come with the Sprite Renderers and so they can be painted without a TIlemap. Which is why you were able to delete the Tilemap. The GameObject Brush however, only picks/paints GameObjects and not Tiles.

    To pick/paint Tiles, you can try the Default Brush.
    1. To have that working, you'll need to have at least a Tilemap in your Tile Palette Prefab. No worries if you have accidentally deleted the Tilemap. You can right-click in the Hierarchy window > 2D GameObject > Tilemap > Rectangular to create a new one.
    2. To populate your Tile Palette with Tiles, the easy way is to drag your entire (sliced) Sprite Sheet into the Tile Palette like how's done in this Tilemap YouTube tutorial [2:55].
    3. Else, the easiest way might be to follow the tutorial and start from scratch to create a fresh new Tile Palette.
    Then I guess you should be all set. Anyway, thank you for walking us through your first Tilemap experience. Have fun painting! :)
     
  17. SaltChaos

    SaltChaos

    Joined:
    Sep 3, 2022
    Posts:
    9
    Thanks for the additional tips, filling the Tile Palette with individual tile were taking way too much time especially.
     
  18. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Happy to help! Yeah I agree. Dragging in your entire texture/Sprite sheet into your Tile Palette is not only faster but it also populates the Tiles the same way as your sliced Sprites in your texture/Sprite sheet. Sometimes that can be very helpful too.