• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
12
Question by ackley14 · Aug 02, 2015 at 11:01 PM · animationnullreferenceexceptionanimation controllerunknown

[Solved]unexplanable null refrence exception

so i was working with animation for the first time today using it to animate part of a (4.5) UI. and at one point (really not sure when) i started getting this nullref error. it doesn't seem to do anything...but its there and it worries me that it could be hurting something in the background. i have no scripts for this animation its 100% done with the editor (animation editor and the animation node editor) heres the stack trace. maybe someone can help me figure out what's causing it so i can put a stop to it

(p.s. : i completely removed the animation controller from the game object and this was still happening so i really don't know right now why this is a thing)

 NullReferenceException: Object reference not set to an instance of an object
 UnityEditor.Graphs.AnimationStateMachine.TransitionEditionContext.BuildNames () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/TransitionEditionContext.cs:44)
 UnityEditor.Graphs.AnimationStateMachine.TransitionEditionContext..ctor (UnityEditor.Animations.AnimatorTransitionBase aTransition, UnityEditor.Animations.AnimatorState aSourceState, UnityEditor.Animations.AnimatorStateMachine aSourceStateMachine, UnityEditor.Animations.AnimatorStateMachine aOwnerStateMachine) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/TransitionEditionContext.cs:28)
 UnityEditor.Graphs.AnimationStateMachine.AnimatorTransitionInspectorBase.ComputeTransitionContexts () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/AnimatorTransitionInspectorBase.cs:125)
 UnityEditor.Graphs.AnimationStateMachine.AnimatorTransitionInspectorBase.OnEnable () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/AnimatorTransitionInspectorBase.cs:87)
 UnityEditor.Graphs.AnimationStateMachine.AnimatorStateTransitionInspector.OnEnable () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/AnimatorStateTransitionInspector.cs:58)
 

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zach-r-d · Aug 02, 2015 at 11:05 PM 1
Share

Did you try restarting Unity?

avatar image Positive7 · Aug 02, 2015 at 11:06 PM 1
Share

Restart Unity

avatar image ackley14 · Aug 02, 2015 at 11:16 PM 0
Share

oh wow.....thanks hahaha now i feel dumb XD

4 Replies

· Add your reply
  • Sort: 
avatar image
41
Best Answer

Answer by ackley14 · Aug 02, 2015 at 11:23 PM

Had to restart unity! thanks to zach.r.d and Positive7 for the tip!!!

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Crow_AL · Oct 24, 2017 at 08:02 PM 4
Share

There has to be a better way.. restarting Unity sucks. I have to restart each time I make a tiny change in the animator..

Add a transition --> Animator crashes to spam null refrence exception Turn off Has Exit Time --> Animator crashes to spam null refrence exception Add a Condition --> Animator crashes to spam null refrence exception etc etc :( :( :( :(

avatar image jackhearts · Jan 22, 2018 at 10:32 PM 0
Share

Had the same problem after referencing the animator in code. Thought it was something in the code at first. Bit annoying, going to restart next time!

avatar image AndyUr · Sep 03, 2018 at 05:25 PM 1
Share

Hey I know this is an old thread, but it's still the top result for this issue. Just wanted to note that this is still happening in Unity 2018.2.0f2.

In this version closing and reopening the animator and animation tabs fixes this.

avatar image SimRuJ · Sep 18, 2018 at 02:47 PM 0
Share

I just got this error in 2017.3.1f1 when I hit the "play" button in the "Game" tab (everything was reacting on a big delay afterwards), even though I don't use any animations.

avatar image rajeev-c · Nov 19, 2018 at 07:14 AM 1
Share

I am getting the same issue in Unity 2018.2.14f1

Show more comments
avatar image
4

Answer by lojack84 · Nov 19, 2018 at 11:08 PM

Yeah try restarting Unity. Sonewhat inexplicable null reference voids occur in 4.5. These do not persist after the game is compiled.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rodeowild · Sep 06, 2020 at 06:33 PM 0
Share

This does not work, or rather it works for about twenty minutes. unity version: 2019.2.17.f1

avatar image
0

Answer by SuperCool83 · Sep 05, 2017 at 03:12 PM

I found my Animation Play, Pause and Next Frame buttons were Red suggesting the animation was still trying to record key frames. Once I turned these off (by pressing the red play button again - the one that normally enters the play game mode) I was able to continue as before.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Manish_kunwar · Mar 07 at 08:53 AM

just save your current layout, it should solve your error,

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

38 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Slow down animation with constantly pressing mouse,I have to keep pressing the mouse to slow the animation BlendSpeed. 0 Answers

How to play 'open door' animation on only one door? 0 Answers

Problem playing script with animation 0 Answers

Help with animations! Player becomes a stick figure.,Player becomes a stick when moving. 0 Answers

Animation loops seems to hang on last frame 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges