Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

(Case 1099078) Issue with AnimationCurve / Prefab / Struct / Transform References

Discussion in '2018.3 Beta' started by dzamani, Nov 8, 2018.

  1. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    Hi,

    We encountered an issue with a specific use case, here is the context:
    - We have a struct with a Transform field THEN (order matter) an AnimationCurve field. It's marked as Serializable.
    - We have a Monobehaviour script with an array of this struct.
    - There is a Prefab with one root Gameobject (which has our script) and 2 children.
    - A base scene with nothing in it for now
    - Unity 2018.3.0b8

    So first, go into prefab edit mode for our prefab, and open the inspector for our script. Then add 2 elements into the list, drag & drop each children of the root gameobject into each elements (the animationcurve can be left as is).
    Now go to the scene and add an instance of our prefab to it. Check the inspector and select the list inside our script. You should see the 2 elements with the Transform references. Click on the first one, it should work, now click on the second one and you should see that it will try to select the reference not inside the scene but the one from the prefab itself. (This is the issue).

    Now the funny thing is this: add a Transform field AFTER the AnimationCurve field in the struct. Look at the prefab instance you have in the scene, the references are still broken, now translate a bit one child of the root gameobject, the point here is to trigger the ability to call "Apply changes" to the prefab, so then apply your changes (reminder, we are not in the prefab edit view here, we are in the regular scene view). Now check again the references, you will see that they are working like they should.

    This is a very specific case but I think that it may lead to a real big issue that has a bigger impact on other things.
    I've added a project showing this issue.

    Hope it was already known since I did not find much information about this.

    Thanks!
     

    Attached Files:

    Last edited: Nov 9, 2018
    guizmoquutamo likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Could you please submit a bug-report, as explained in this document:
    https://unity3d.com/unity/beta/guide-to-beta-testing#tab-3

    After you submitted the bug-report, you'll receive a confirmation email with a bug-report case number. Please post this case number here for Unity staff to pick up.
     
  3. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    Yeah sorry I forgot to update the thread with that (I did the bug report yesterday just after the thread).
     
    LeonhardP likes this.
  4. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    Fixed in 2018.3.0b10.