Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Incompatibility with Nested Prefabs
#1
It seems that Obi Rope (and probably the other systems, I haven't tried) are completely incompatible with the new Nested Prefab workflow. The only way I can manage to keep Pin Constraints / Handles intact is if they are just plain scene objects, it doesn't work from within prefabs anymore.

Any ETA on when this will work again? It's a real pain to have to work without prefabs.
Reply
#2
(24-04-2019, 06:08 PM)herbst Wrote: It seems that Obi Rope (and probably the other systems, I haven't tried) are completely incompatible with the new Nested Prefab workflow. The only way I can manage to keep Pin Constraints / Handles intact is if they are just plain scene objects, it doesn't work from within prefabs anymore.

Any ETA on when this will work again? It's a real pain to have to work without prefabs.

Hi,

We're not doing any custom/out of the ordinary serialization, so it all relies on Unity's built-in serialization/prefab system.

When you create a handle, it is by default added to the scene root (outside the prefab). This is by design as handles are supposed to act as anchors to the "outside" world, but nothing stops you from making them part of the prefab hierarchy if you wish to.

Same goes for pin constraints, if they hold a reference to an object outside the prefab hierarchy the reference will be lost as Unity does not support a prefab having references to anything that exists outside the prefab (not in the old prefab system, nor in the new system). Same solution, place the object you want to pin your rope to inside the prefab.

kind regards,
Reply
#3
Hi, I welcome you to test the behaviour and you'll see that just having an entire rope hierarchy inside a prefab breaks the attachment points (that are also parts of the prefab).

Additionally, please not that in fact, it is very much possible to have references from inside an instantiated prefab to the "outside world", because the scene the prefab is in will hold that reference (or, for nested prefabs, a parent prefab depending on where the referenced object lives).

If you can't test that yourself or find something different, please let me know where/how to submit a (confidential) bug report.
Reply
#4
(07-05-2019, 02:29 PM)herbst Wrote: Hi, I welcome you to test the behaviour and you'll see that just having an entire rope hierarchy inside a prefab breaks the attachment points (that are also parts of the prefab).

Hi there,

I just tested this, but it works fine for me. Pin constraints are kept within the prefab. If you have a repro project showing otherwise, please send it to support(at)virtualmethodstudio.com and I'll personally take a look at it.

Code:
Additionally, please not that in fact, it is very much possible to have references from inside an instantiated prefab to the "outside world", because the scene the prefab is in will hold that reference (or, for nested prefabs, a parent prefab depending on where the referenced object lives).

From an instantiated prefab yes, but not within a prefab. Prefabs themselves exist independently of any scene, so they cannot hold any references to something that is not part of the prefab. Once you instantiate the prefab within a scene then yes, it behaves just like a regular GameObject. I just wanted to point this out because many users in the past assumed they could pin a rope to something in the scene, make a prefab out of it, instantiate the prefab multiple times and these instances would still retain the pin constraint reference.
Reply