❄️🎁⛄ The Winter Games Tournament is Live! 🎄🎅❄️
Jump to content

Should prefab sub-object orientations be always locked in place and loaded from the prefab file, or should the editor allow prefab subobjects to be moved and rotated?  

1 member has voted

  1. 1. Should prefab sub-object orientations be always locked in place and loaded from the prefab file, or should the editor allow prefab subobjects to be moved and rotated?

    • Locked prefab sub-objects in place
      0
    • Prefab sub-objects can be moved in editor
      1


Recommended Posts

Posted

Currently, the position, rotation, and scale of sub-objects in a prefab is stored for each scene. If you have a prefab that contains a door frame and door, for example, you can place the prefab and then make the door opened or closed, and that new orientation of the door piece will be stored in the scene. If you edit the original prefab file, other properties will update when the scene is reloading, but changing the position of the door piece in the prefab file will not affect the subobject in scenes where it has already been placed.

The other way of doing this would be to always get prefab orientations from the prefab file. This means if you have a prefab that is an assembly of parts, you would not be able to adjust the position or rotation of any sub-object in the editor, because it would be locked in place, relative to the parent. The only way to make the door opened, for example, would be to unlink the prefab, after which it will not refer back to the original prefab file, and will not get updated if anything in the prefab is changed.

Which do you think is a better design choice for the majority of the time?

 

Let's build cool stuff and have fun. :)

Posted

Why does it have to be either/or? In other engines with prefabs, you can change the children of a prefab (scale, position, and rotation) and things like doors can still be made to open/close. It seems to me (and I may not use the correct lingo here, so please forgive in advance) that a prefab should use some kind of 'local' coordinate for its children and any changes made to the actual (main) prefab would propagate to all instances based on that. 

If it has to be either/or (as you describe above), then I would opt for the second one. Then I would create prefabs only of static objects and individually place non-static objects, like doors.

Creating professional 2D and 3D content is my passion!
Monkey Frog Studio

Posted

 

7 minutes ago, Monkey Frog Studio said:

Why does it have to be either/or? In other engines with prefabs, you can change the children of a prefab (scale, position, and rotation) and things like doors can still be made to open/close. It seems to me (and I may not use the correct lingo here, so please forgive in advance) that a prefab should use some kind of 'local' coordinate for its children and any changes made to the actual (main) prefab would propagate to all instances based on that. 

Uhhhh, what? That sounds like two contradictary things:

  1. Prefab sob-object orientations should be unique, stored in the scene. You move a sub-object of a prefab in the editor and it stays moved.
  2. Prefab sub-object orientations should always be the same relative to the parent in the prefab hierarchy, and changes to the prefab file should show when a scene is loaded.

You have to choose one or the other. Currently, the first is what the editor does.

Let's build cool stuff and have fun. :)

Posted

Again, I don't have the proper terminology. But to keep it simple (I hope), in other engines, like Unreal, you can adjust the main prefab as you please and these changes propagate to all instances. You can still have moving doors as part of the prefab. In fact, you can attach the script there to the door in the prefab. 

Creating professional 2D and 3D content is my passion!
Monkey Frog Studio

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...