- Home /
Prefab Brush from 2d-extras not working in tilemap
I'm trying to use prefab brush in my project as shown in official unity tutorial here -> https://unity3d.com/learn/tutorials/topics/2d-game-creation/custom-tilemap-brush-spawn-prefabs?playlist=17093 but it doesn't work. It just places one object and then it doesn't paint more prefabs and there are thrown really ugly exceptions in console -> https://pastebin.com/bTX8vZbB
It REALLY seems like a bug, any idea how to fix that?
Ok, I just noticed something, if I deselect tilemap I'm painting on and select it again, it lets me put one more object and then it breaks again. If I do the same once more I can create next object and so on. Hope that helps to pinpoint what's wrong. I can't fix that unfortunately, it's black magic for me :(.
Answer by leonardo-santoslopes · Jan 02, 2019 at 07:38 PM
Hello,
I do have the same problem with Unity version 2018.3.0f2.
Trying to follow up the tutorial "The Ultimate Guide to 2D Mobile Game Development With Unity".
It is the same behavior as mentioned by @bibbis with the same "workaround".
But, select the desired tilemap in the grid each time we place "one" prefab is not really a good solution to perform.
I really appreciate any feedback if someone has the solution for that.
Answer by chrustol · Jan 03, 2019 at 11:11 AM
Same here. The Active Tilemap is deselected after every prefab placement.
Answer by antonsem · Dec 26, 2018 at 05:38 PM
Having the same problem. Tried in 2018.3.0b11 and in 2019.1.0a8. Reselecting the Tilemap is not really a solution, it would be easier to place the prefabs manually...
So anyone has a solution?
Answer by Ziloers · Jan 07, 2019 at 07:18 PM
It's been a while, hoping someone fixes it on version 2018.3.0f2
Answer by windd123 · Jan 19, 2019 at 08:35 AM
Fortunately, this problem can be fixed by simply adding a private variable to store previously valid brushTarget.
I have submitted a pull request too, check it here: https://github.com/Unity-Technologies/2d-extras/pull/72
Your answer
Follow this Question
Related Questions
2D Tilemap prefab brush doesn't paint the tile in the right place 0 Answers
2D Tilemap increase custom Brush size 0 Answers
Reusing tilemap segments 0 Answers
[Tilemap] Can you spawn a Prefab (with colliter) together with a tile when placing it? 0 Answers
Trouble with tilemaps as prefabs for 2D plattformer 1 Answer