Open daelfer opened 4 years ago
Could you share some details about the Tilemap component you are painting on? For example, a screenshot of the inspector of the Tilemap and Grid GameObjects?
There is a recent update to the PrefabBrush by vladderb that allows you to toggle whether you want multiple copies of the Prefab onto the same cell which would be helpful for the duplicates issue.
in this image the long grass to the right of the camera is painted on the grid that has a scale of 1x1x1. It ended up where i painted it just fine except for some reason it placed the prefab at z position of 0.5 the grass to the left of the camera is on the grid with a scale of 0.125x0.125x0.125 and it did not end up where i painted it and you can see in the inspector that all of its transforms have been multiplied by 8. I painted it at position -1.5 , 0.125 , 0 Somehow it is trying to compensate for the scale
Could you share the screenshots of the Grid, Normal Grid 1x1x1 Scale and Grid 0.125x0.125x0.125 Scale? I assume that the Grid component is on the Grid GameObject, while its children have the scales adjusted?
You said something interesting. I had been setting the scale of the object with the tilemap components to 0.125. This time i tried to create a 2nd gameobject with a grid component on it and scalled down that object then left the tilemap that i put on it at scale 1. This time it worked. It was still trying to rescale my prefab to compensate so i just set the scale of the prefab to 0.125. Now i just need to find this fix that vladderb did to solve the problem with duplicates and im back in motion.
ummm so i looked around... where do i get this prefab brush fix from?
The scaling issue looks like a bug, so we'll check it out and fix that.
You can use the PrefabBrush from master. There is a "Force Delete" option in the Brush Inspector at the bottom of the Tile Palette. Enabling that should help ensure only one of the prefabs exist per cell.
On Wed, 25 Mar 2020, 7:01 pm daelfer, notifications@github.com wrote:
ummm so i looked around... where do i get this prefab brush fix from?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/2d-extras/issues/189#issuecomment-603777213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA3TEWB4RV2Y5LK3H5X3ODRJHQCFANCNFSM4LR5JDAA .
Ah that works perfectly. Shame that option isnt on the prefab random brush as well
never mind. even though it doesnt have the check box it does it automatically. am so super stoked now about this project. My students will be so happy
hmmm. i replaced the folder called "Prefab Brushes" with the fonder called "PrefabBrushes" and all seemed to be working great. until i went to build and i got tonnes of errors. Initially i installed the 2018.3 branch then under master i downloaded as zip and took the prefabbrushes folder from that zip file to add to my project and poof errors
Do the errors occur only during building a Player?
For 2018.3, the folder structure for brushes are a little specific as they exist in the Assets folder. You will need to create an Editor folder like Assets\Tilemap\Brushes\Prefab Brushes\Editor
, and move all the files into the Editor folder. This tells Unity that the script files under the Editor folder are only for the Editor and not the Player. The errors you get when building should not occur as Unity will not build the Prefab Brush scripts into the Player.
Hope this helps!
this isnt making any sense the prefab brushes and the tiles are inside the editor folder not the other way around,, I even got rid of all of the 2016.3 files and added all of the files and folders in the master branch into assets and now im getting a whole new set of errors. i have no clue how to install this. The files in the 2018.3 download were easy to install since they were wrapped up in a folder to be installed into the assets folder but i dont know what to install from the files in the 2D-extras folder or where to install them.
It is important that the Prefab Brush script (The .cs files) are contained in a folder (or with a parent folder) named Editor. Based on the console log screenshot you shared above, they do not appear to be so.
The Prefab Brushes and the Tiles you have created generally can be placed elsewhere, so they are fine.
You could try the following setup after making a backup of your existing project:
Assets/Tilemap
. Assets/Tilemap
should go to Assets/Tilemap
in your project folder.Assets/Tilemap/Brushes/Prefab Brush
folder from your project as you want to replace it with the Prefab Brush from the master branch here.Prefab Brush
folder at Assets/Tilemap/Brushes
(You will get Assets/Tilemap/Brushes/Prefab Brush
).Editor
folder at Assets/Tilemap/Brushes/Prefab Brush
(You will get Assets/Tilemap/Brushes/Prefab Brush/Editor
)Editor/Brushes/PrefabBrushes
to Assets/Tilemap/Brushes/Prefab Brush/Editor
.If you are copying or deleting files outside of the UnityEditor, remember to copy or delete the corresponding .meta files as well.
you wonderful wonderful wonderful person you. Thank you sooo much
I have different tilemaps using different scales and all seems fine. When i try to paint with a prefab brush on a tilemap set to any scale that is not 1,1,1 then the object is painted, but thrown far off of the location it should be on the grid. (Also just wanted to say that the prefab brush allows you to paint multiple objects in the same tile making for duplicates that are not needed.) Other than that im loving all of these additions.