Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Modifying the sprite in a prefab brush

Discussion in '2D' started by kylebengzon, Mar 6, 2020.

  1. kylebengzon

    kylebengzon

    Joined:
    Sep 26, 2019
    Posts:
    11
    Hi everyone,

    I watched a couple of youtube videos that used the prefab brush

    Reference:

    and

    but neither of them gave a hint on how I could fix my problem.

    I made a prefab brush of a bush sprite that is sized at 2x3 cells, and I can paint the bush prefab on a tilemap no problem. The issue is that the bush is always centered on the tile I place it on, painting it in an awkward position (please see attached image). What I wanted to learn was: How do I change the position (and other aspects like size) of the prefab inside the brush?
     

    Attached Files:

  2. Darksacs

    Darksacs

    Joined:
    Aug 5, 2020
    Posts:
    2
    you found a solution?, ive same issue
     
  3. kylebengzon

    kylebengzon

    Joined:
    Sep 26, 2019
    Posts:
    11
    Darksacs

    I have not found a solution unfortunately
     
  4. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    You can set the anchor position for your Prefab Brush such that it aligns better with your Grid. Hopefully that helps!

    upload_2020-8-6_10-47-53.png

    This is found at the bottom of the Tile Palette window. You may need to drag up the bar with the lines to see it.
     
  5. kylebengzon

    kylebengzon

    Joined:
    Sep 26, 2019
    Posts:
    11
    Thanks for the response ChuanXin

    My prefab brush does not have the Anchor property though (Please see attached image)
     

    Attached Files:

  6. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    You may need to update this file to the version found here: https://github.com/Unity-Technologi...itor/Brushes/PrefabBrushes/BasePrefabBrush.cs

    I am not sure how you have added the 2D extras to your project. If you added it through git or the package manifest file, you may need to delete the corresponding Packages/packages-lock.json file to get an updated version. Otherwise, if you added the files to your project manually, updating the files direct should work.