Thoughts on using collections as prefabs

Random feedback while working with the editor:

Because i cannot edit the scale of a sprite in the editor, I’m forced to wrap it in a game object. But! I’d like to work on a “prefab” game object and then instantiate it multiple times in my root collection (during scene design, not at runtime). I’m currently having two problems when trying to use a collection as a prefab:

  1. I’m trying to change the Default Animation (or any component property) of a sprite component in one instance of my prefab collection and, instead of the property turning blue, meaning it’s only overriden for the current instance, it changes the animation in the collection itself, changing all my instances.
  2. Collections cannot be parented to another game object. If I used a game object as my “prefab”, that would be ok, but there are situations when you realise that a game object is not enough and you’d wish to refactor it to a collection. This limitation prevents that refactor in some cases.
3 Likes
  1. Yeah, this edits the referenced file in place. This is a big UI issue that needs design work. Not sure how far the editor guys has come with this. @mats.gisselson or @Erik_Angelin may know more.

  2. Do you mean something in the gist of ”mark a few game objects, right click and select ’move into new collection file’?

  1. Yeah. It’s a bit weird. I can override game object properties like position, rotation, etc. just fine. It’s just that if I click on a component from a game object in a nested collection, a few weird things happen:
  • I can’t override its props. It edits the original.
  • The URL is shown as /go#sprite instead of /collection/go#sprite
  • Even if in the outline I selected /collection1/go#sprite, in the canvas view it will select some other /collection2/go#sprite if collection1 and collection2 are referencing the same collection file.
  1. Yeah. That would be a useful feature, now that you mention it. I’m ok even with being able to do this manually (create new collection file, then copy paste some game objects into it, then replace the old game objects with the new collection). But the problem is that, right now, this only works for top-level game objects, as collections cannot be parented to a game object.
2 Likes