# Question about add collection file in collection

**URL:** <https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269>\
**Category:** Questions\
**Created:** [July 11, 2019, 9:07am UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269 "2019-07-11T09:07:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![astone](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/astone/32/14018_2.png) [@astone](https://forum.defold.com/u/astone)\
**Post date:** [July 11, 2019, 9:07am UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/1 "2019-07-11T09:07:43Z")

</div>

I add a collection file ‘A’ in collection ‘B’ and change the position of game object which is belong to A collection in B collection, when I restart the defold, the change didn’t work.

 ![TIM%E6%88%AA%E5%9B%BE20190711170724](https://forum-defold-uploads.b-cdn.net/original/3X/9/5/958bbd9af44c2310d95ff13f63b2b2b61ed290e4.png)

---

<div class="post-metadata">

**Author:** ![astone](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/astone/32/14018_2.png) [@astone](https://forum.defold.com/u/astone)\
**Post date:** [July 11, 2019, 9:12am UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/2 "2019-07-11T09:12:02Z")

</div>

Is this a bug? or it is working like this?

---

<div class="post-metadata">

**Author:** ![ross.grams](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@ross.grams](https://forum.defold.com/u/ross.grams)\
**Post date:** [July 11, 2019, 12:16pm UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/3 "2019-07-11T12:16:52Z")

</div>

That’s just how it works. You can change the position, rotation, and scale of collection ‘A’ inside collection ‘B’, but you can’t move the game objects inside collection ‘A’ (without modifying the original and therefore all instances). I believe the only things you can change per-collection-instance are script properties.

The editor is kind of bad about enforcing and showing these things. Some things, like the transforms, show up in the editor but are wiped on restart, other things, like changing the default animation on a sprite, will actually modify the prototype collection.

Note that if you, say, change the scale of collection ‘A’, that scale will be applied to all the game objects in that collection, if you check it at runtime.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [July 11, 2019, 7:14pm UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/4 "2019-07-11T19:14:19Z")

</div>

> [@ross.grams](#):
>
> The editor is kind of bad about enforcing and showing these things. Some things, like the transforms, show up in the editor but are wiped on restart, other things, like changing the default animation on a sprite, will actually modify the prototype collection.

@vlaaad and @markus.gustavsson can we do something to make this more clear in the editor?

---

<div class="post-metadata">

**Author:** ![ross.grams](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@ross.grams](https://forum.defold.com/u/ross.grams)\
**Post date:** [July 11, 2019, 8:35pm UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/5 "2019-07-11T20:35:58Z")

</div>

> [@britzl](#):
>
> can we do something to make this more clear in the editor?

In my opinion they should just not be allowed at all—make those property fields read-only or not show them.

---

<div class="post-metadata">

**Author:** ![astone](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/astone/32/14018_2.png) [@astone](https://forum.defold.com/u/astone)\
**Post date:** [July 12, 2019, 2:04am UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/6 "2019-07-12T02:04:33Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![markus.gustavsson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/markus.gustavsson/32/12961_2.png) [@markus.gustavsson](https://forum.defold.com/u/markus.gustavsson)\
**Post date:** [July 12, 2019, 4:43am UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/7 "2019-07-12T04:43:02Z")

</div>

Thank you for bringing this to our attention. We will look into making the behavior more intuitive. Or at least document better what is going on and why.

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [July 12, 2019, 7:52am UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/8 "2019-07-12T07:52:04Z")

</div>

Agreed, I’d prefer it to be read-only.

---

<div class="post-metadata">

**Author:** ![Scmorr](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/scmorr/32/31748_2.png) [@Scmorr](https://forum.defold.com/u/Scmorr)\
**Post date:** [March 19, 2023, 11:43pm UTC](https://forum.defold.com/t/question-about-add-collection-file-in-collection/57269/9 "2023-03-19T23:43:42Z")

</div>

Actually, I would suggest different thing. Much better to just apply change immediately to collection file (and all instances), because this is the same logic as instant applying changes of game object properties to all instances.  
Just an example - I have instance of game object with sprite and changed position X of sprite in editor. It is immediately applied to game object file and all other instances. Let’s say I have instance of collection file deep in hierarchy with some game object inside. With the same logic I expect that after I change position X of game object - this will update collection file immediately (and all instances of this collection file). Instead I see change applied just visually in editor. However, logic works with other actions - if I remove game object from instance of collection file somewhere in deep hierarchy - this action applied immediately for collection file and all instances.  
Another reason to avoid “read-only”: let’s say I have sophisticated scene and trying to tweak few positions of some objects. I need to do this in a full scene to see how it looks. But, after I make tweaks, I need to white them down in notebook (because they applied only visually!) then enter appropriate collection files, where these objects are first tier children and re-enter changes. Which is weird.
