code-google-com / itween

Automatically exported from code.google.com/p/itween
0 stars 0 forks source link

NullReferenceException error in iTween.cs #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This error happens when I import iTween.cs into any project:

NullReferenceException: Object reference not set to an instance of an object
iTween.LateUpdate()(at Assets/iTween/iTween.cs:6583)

The program still runs but this error stays in the console. 

Unity 3.4.2f2
Win7 64 bit

Original issue reported on code.google.com by lpark2...@charter.net on 29 Oct 2011 at 12:44

GoogleCodeExporter commented 9 years ago
I ran into this as well, and have a fix I think does the trick.

Inside LateUpdate(), switch the order of the checks so it looks like this:
if(isRunning && tweenArguments.Contains("look target"))
Also, set isRunning=false before every call to Destroy(this); (especially in 
Dispose())

Original comment by entropic...@gmail.com on 24 Feb 2015 at 5:21

GoogleCodeExporter commented 9 years ago
Actually, I think if you save any code file, even if you only removed some 
whitespace, while Unity is running it seems to trigger this, but not otherwise. 
 However, it seems to not only affect iTween; other objects of mine get 
destroyed as well.

This post suggests making data serializable can help avoid this problem, so 
maybe that's something iTween can do? 
http://answers.unity3d.com/questions/532242/editing-code-in-debug-mode.html

For now, restart your game after making any code file changes.

Original comment by entropic...@gmail.com on 27 Feb 2015 at 4:40