Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Major confusion with parenting and references via inspector

Discussion in 'UGUI & TextMesh Pro' started by jtsmith1287, Apr 1, 2015.

  1. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    EDIT: I think this is resolved. Carry on. Nothing to see here.

    It seems like a lot of built in stuff in Unity is designed to be assigned (rhyme, lol) via the inspector with a simple click and drag. Cool, I dig this. Except...

    I've got a "launch pad" and a UI for the controls of the launchpad all nested under an empty gameobject so that I can save it as one prefab and just click and drag the whole thing into my scene. The UI has event triggers that reference the launchpad. I can click and drag the launchpad into the OnPointerDown etc etc and assign the method and everything works. So I click "Apply" to set the prefab. On creating a new scene I add the container prefab and nothing works, despite there being an event system and the references all intact.

    At this point I can go to my other scenes where I'm using this prefab and they're all broken too (with all references still intact)! I have no idea what's going on. I've used drag and drop references in other projects with no problem, but I've now spent hours reassigning things over and over. I've changed up parent/child order thinking there was something going wrong there but I've made zero progress on the issue, which leads me to believe there's some caveat I'm unaware of.

    If anyone has any idea of what's going on that would be awesome. And if you need more detail to answer let me know and I'll add a screenshot or describe it in more detail. Thanks.
     
    Last edited: Apr 1, 2015
  2. louisgv

    louisgv

    Joined:
    Aug 7, 2013
    Posts:
    18
    I need a screenshot of your hierarchy and of the serialized field you used to "drag-n-drop" your references. Are the reference you drop in also a prefab? Since If they only present in some scene,, it might not carry into another scene..
     
  3. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    As soon as I posted this Things started working again. -_-

    I ran around and tried testing and breaking things to be sure it was working and not hanging by a thread. I also crashed unity by deleting some prefabs and trying to load a scene that used them. I THINK I had some cross referencing in the prefabs (I had done a lot of shuffling to get the organization I wanted) that was causing issues.