Trouble with lost associations in the inspector

Hi Folks,

After having previously and successfully made associations in the inspector (dragging and dropping textures or gameobjects into appropriate public variables) they will sometimes be lost as if I had never made them.

As a clarifying point, the associations had been made, were successfully operating and in effect for many days and updates to scripts and builds prior to them being lost (no association in the inspector).

I’m not sure that I’ve identified a recreate-able scenario but it may be connected to when I get a lot of null references during development.

My question is:

Have you noticed this before (as it is extremely frustrating) and is this avoidable?

Thank you.

Some reasons why this could happen:

  • If the editor was in play mode, it can be explained, as any changes to scene assets will be reverted when you stop play mode.
  • If the editor crashed and you hadn’t saved the scene, then obviously the references would be lost.
  • If you cut and paste or rename files outside of Unity, chances are that you’ll confuse Unity. Rename and move files inside Unity.
  • If you rename a public variable, chances are that that Unity is unable to figure out that “player” should be the same as “target”.