Obi Official Forum
Bug / Crash Duplicate rod is inheriting attached particle from original - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Bug / Crash Duplicate rod is inheriting attached particle from original (/thread-3028.html)



Duplicate rod is inheriting attached particle from original - willmedeiros - 19-07-2021

When I duplicate an ObiRod blueprint and increase its length and add to the ObiRod of the new object with two attachments, the attachment position remains that of the original object even after adjusting the attaching objects

The small cable in the middle is the original cable.
The large cable with a dropped part is duplicated from the original with only the blueprint and the position of the connectors changed.
The large cable that is working was made from scratch using the same blueprint as the previous one.

[Image: yhhMHrT.png]


RE: Duplicate rod is inheriting attached particle from original - josemendez - 20-07-2021

Is this cable a prefab by any chance? we recently fixed a bug that caused prefab overrides to reset attachment particle indices at runtime. The fix should be out next week.

Let me know if this is the case, so I can make the patch available to you.

kind regards,


RE: Duplicate rod is inheriting attached particle from original - willmedeiros - 20-07-2021

(20-07-2021, 08:35 AM)josemendez Wrote: Is this cable a prefab by any chance? we recently fixed a bug that caused prefab overrides to reset attachment particle indices at runtime. The fix should be out next week.

Let me know if this is the case, so I can make the patch available to you.

kind regards,

Yes, it's a prefab and I believe it's the same bug, because I tested it after getting the prefab, changing the length and changing the particle names, then I went back to the original names and redefined it in the "particle group" of the attachment and it worked, me seems to be this bug


RE: Duplicate rod is inheriting attached particle from original - josemendez - 20-07-2021

(20-07-2021, 01:24 PM)willmedeiros Wrote: Yes, it's a prefab and I believe it's the same bug, because I tested it after getting the prefab, changing the length and changing the particle names, then I went back to the original names and redefined it in the "particle group" of the attachment and it worked, me seems to be this bug

If that's the case, go to ObiParticleAttachmentEditor.cs, line 109, add a call to PrefabUtility.RecordPrefabInstancePropertyModifications(). Should look like this:


Quote:void OnParticleGroupSelected(object index)
{
Undo.RecordObject(attachment, "Set particle group");
attachment.particleGroup = index as ObiParticleGroup;
PrefabUtility.RecordPrefabInstancePropertyModifications(attachment);
}

After this change, select the offending attachment and re-select the particle group (click the particle group dropdown, and just select the same particle group). That should fix the issue.

Let me know how it goes!


RE: Duplicate rod is inheriting attached particle from original - willmedeiros - 20-07-2021

(20-07-2021, 01:27 PM)josemendez Wrote: If that's the case, go to ObiParticleAttachmentEditor.cs, line 109, add a call to PrefabUtility.RecordPrefabInstancePropertyModifications(). Should look like this:



After this change, select the offending attachment and re-select the particle group (click the particle group dropdown, and just select the same particle group). That should fix the issue.

Let me know how it goes!

worked perfectly! thank you so much for the support!