GameObjects losing their Prefab connection in the Tile Palette

Original Post:
Original Post

When using the GameObject Brush to paint GameObjects as tiles on a grid, the GameObjects lose their Prefab connection when they are painted.

This makes the GameObject Brush completely useless, because what if I’m painting coins all over my level, and then I decide to change the sound effect of the coin (of which is a field on the coin itself)? Now I have to go repaint every level that has coins in them just for the coins to be updated with the new sound effect.

Please make GameObjects painted using the GameObject Brush maintain their Prefab connection.

(Note: I am on 2020.2.0b6. If the above feature request is how things are already supposed to work, does 2020.2.0b7 work as normal?)

EDIT:
It seems that it is possible to paint prefabs without losing the Prefab connection!

The issue that seems to be occurring (and led me to my initial conclusion) is that after you define the GameObject to be created (in the Cell’s GameObject field), once you click off the Tile Palette, the Tile Palette generates a Clone of the Prefab and replaces the GameObject (in the Cell’s GameObject field) with the generated Clone, destroying the Prefab connection.

To me, this seems like a serious bug (or there needs to be a toggle for this functionality, because I do not want it!).

Would someone mind fixing this?

It’s just instantiating the prefab, same as if you called it from code. Is this not the desired behavior?

I would much prefer that it would create the GameObject as if it were being placed manually in the Editor by hand (I.E. as if you grabbed the Prefab from the Project window and dragged it into the Scene view or Hierarchy) so that the Prefab connection would remain intact, and any edits made to the Prefab would be reflected across all “Tile” GameObjects created in this manner.

This should be fixed in 2020.2.0b8 and in 2020.1.10f1, where if you were picking a Prefab instance from the Tile Palette and painting with it, it would generate a clone instead of a Prefab instance.

1 Like

I have upgraded to 2020.2.0b8 and I can confirm this does not solve my problem.
It seems like my problem is similar, yet a different problem than the one you described. Assuming you have a Prefab with a Grid Component to store the paint-able Prefabs set up properly, all you have to do is:

  • Select an empty tile in the Tile Palette.

  • Within the “Cells” list of data, find the GameObject field (in any Element of the Cells list).

  • Specify a Prefab in this field.

  • THEN…

  • Click on another tile in the Tile Palette.

  • Return to the tile that you specified the Prefab for.

You will notice that the tile generated a Clone of the Prefab and replaced the Prefab (in the GameObject field) with the generated Clone.

This is the problem I am experiencing.

Sorry, I may not be understanding your issue correctly.

Just to confirm, is this using the GameObject Brush and editing the fields in the Brush Inspector (at the bottom of the Tile Palette window)?

If so, when you specify the Prefab in the GameObject field, does it have the Blue icon when you specify it in 3 and pick that Tile again in 6?
6465085--725176--upload_2020-10-28_13-40-54.png

1 Like

Hmm.
Very smart idea posting an image! (In hindsight that would have made it a lot easier to describe the issue accurately). :sweat_smile:
But more importantly — yes, this is using the GameObject Brush and editing the fields in the Brush Inspector. :wink:

Nope! The blue color is gone! :hushed:
When I specify the Prefab in step 3, and then return to it in step 6, the Prefab has been replaced by a generated clone! :frowning:

Sounds like a bug then! I will assume that this is on 2020.2.0b8. Could you share the version of the Tilemap Extras you are using, or the GameObject brush script if you are using it separately? If you have added it through GitHub, could you share the *.json files in your project under the Packages folder?

1 Like

Will do!
Since I’m using the wonderful 2D Tilemap Extras Package, I shall give you the Version Number!
Which is: 2D Tilemap Extras Version 1.6.1-Preview.
And yes, I am using 2020.2.0b8. :wink:
(I have actually just tested this using 2020.2.0b9 as well, and the situation is the same). :stuck_out_tongue:

Thanks for taking a look!
I really appreciate it. :smile:

Sorry, I am unable to reproduce this on my own with the same setup.

Would it be possible to file a bug with your project using the Unity Bug Reporter and post the case number here? It could be possible that this may not work with all Tile Palette or Prefab setups. Thanks!

1 Like

Okay, 'Xin.
I’ve tried to create a repro project (multiple times), but I seem unable to do so. :frowning:
However, I was able to create a properly-functioning GameObject Tile Palette multiple times… so I am going to investigate if I can get things to work on my end within my non-repro project. :wink:

I will get back to you. :sunglasses:

EDIT:
I really have no idea what I did to break the Tile Palette.
BUT, I can now very easily create a properly functioning one!

What is weird about it though, is that I can switch between the “working” and “broken” Tile Palettes at the click of a dropdown! So I guess maybe I set it up wrong the first time?
I dunno…
Very weird.

@ChuanXin , it seems like this issue cannot reproduced (or the steps to reproduce this issue are quite specific / incorrect as far as Unity would be concerned). So I apologize for wasting your time. :sweat_smile:
However, I appreciate you assisting me. :stuck_out_tongue:

But if I ever manage to break the Tile Palette again — I’ll be back. :wink:

Do let us know when that happens, thanks!

1 Like

Sry for posting in such an old tread bu I have exactly the same bug with Unity 2021.2.7f1 ** @NotaNaN ** what exactly did you do to fix this for some of your tile pallets?

I really have no clue… Though, I don’t believe I ever ‘fixed’ my broken tile palettes — rather I recreated them manually and things just worked fine from there. I wish I could provide more help on this matter… but I haven’t used the Tile Palette in a while and I haven’t had the issue again either. :sweat_smile: