Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Error even on empty scene, and :hover doesn't work

Discussion in 'UI Toolkit' started by nixarn84, Sep 16, 2020.

  1. nixarn84


    Jul 25, 2015
    I keep getting this error when I press run, even after I've removed everything from the scene:

    NullReferenceException: Object reference not set to an instance of an object
    Unity.UI.Builder.StyleSheetExtensions.FixRuleReferences (UnityEngine.UIElements.StyleSheet styleSheet) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.6/Editor/Utilities/StyleSheetExtensions/StyleSheetExtensions.cs:45)
    Unity.UI.Builder.BuilderDocumentOpenUSS.FixRuleReferences () (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.6/Editor/Builder/Document/BuilderDocumentOpenUSS.cs:69)
    Unity.UI.Builder.BuilderDocumentOpenUXML.OnAfterDeserialize () (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.6/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:662)
    Unity.UI.Builder.BuilderDocument.OnAfterDeserialize () (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.6/Editor/Builder/Document/BuilderDocument.cs:392)

    And I got a :hover effect to work just fine in the builder, but wont work in play mode. Anyone got any suggestions? I love the idea of UI Toolkit and playing around with it, but now 95% of my time is spent on weird glitches.


    Edit: Maybe this could be deleted, or left here if others have the same problem. The problem was how I created an empty gameobject and added a uidocument to it, so no event system was created.
    Last edited: Sep 16, 2020
  2. mcoted3d


    Unity Technologies

    Feb 3, 2016
    Thanks, it was indeed reported a few times. We're working on it!