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

ScriptableObject gives me leaked object message when I save scene.

Discussion in 'Scripting' started by TheCodez, Jun 24, 2015.

  1. TheCodez

    TheCodez

    Joined:
    Sep 19, 2014
    Posts:
    14
    I have a Mono Behavior that has a public property of a type that inherits from ScritableObject. This type is created by an editor script and saved to a .asset file. The asset file is then dragged on the property. This all works fine, the problem is that when I save the scene I get a message telling me there are leaked object detected of the same type as my scriptable object. What is up with that?

    Thanks,
    Philip
     
  2. Pharan

    Pharan

    Joined:
    Oct 28, 2013
    Posts:
    102
    Shouldn't happen, unless you instantiated (a copy) of the ScriptableObject.

    Then it would've been unserializable in the scene and would have shown that message.

    Can you show the code of the MonoBehaviour that has the public property?

    EDIT:

    My bad. Just tried it. Did nothing special: just added a ScriptableObject to a public field in the inspector. It does say there's a leak. Using Unity 5.1.1f1

    (RoomData is the name of my ScriptableObject)
     
    Last edited: Jun 25, 2015
    ThermalFusion likes this.
  3. TheCodez

    TheCodez

    Joined:
    Sep 19, 2014
    Posts:
    14
    Should I file a bug?
     
  4. Pharan

    Pharan

    Joined:
    Oct 28, 2013
    Posts:
    102
    Go for it.