MaterialUI icon indicating copy to clipboard operation
MaterialUI copied to clipboard

EZAnim - Object reference not set to an instance of an object

Open DrabWeb opened this issue 10 years ago • 3 comments

I've been using EZAnim a lot lately, and for quite a while, but randomly now I get this error when trying to use (EZAnim Variable).Animate(); or (EZAnim Variable).AnimateAll();

NullReferenceException: Object reference not set to an instance of an object
MaterialUI.EZAnim.AnimStruct (Int32 i) (at Assets/MaterialUI/Scripts/EZAnim.cs:67)
MaterialUI.EZAnim.AnimateAll () (at Assets/MaterialUI/Scripts/EZAnim.cs:136)

This randomly happens on random triggers, with them occasionally fixing themselves for no apparent reason. I looked into the error a bit, and at line 67 in EZAnim.cs, it has this

activeList[i] = true;

Now I did some digging and the variable that it is looking for is there, as far as I know. My best guess is it is throwing the AnimStruct function a bad number, making it look for a variable that doesn't exist. If you could help me fix this that would be great!

Thanks, DrabWeb

DrabWeb avatar Apr 17 '15 14:04 DrabWeb

I'll definitely take a look when I can and try and fix that up. Eventually I'd really like to overhaul EZAnim and make it more powerful and easier to use. I think it has to the potential to be a brilliant UI animation tool.

Thanks for letting me know :)

InvexGames avatar Apr 19 '15 14:04 InvexGames

Hi! Thanks for bringing this issue to my attention :)

I'm now working on MaterialUI in a private repo, adding features and the likes for an official release on the Asset Store - this means that I won't be adding/fixing anything more in this repo (sorry). Feel free to fork this one if you'd like to tackle to issue yourself, and/or send me an email at [email protected] if you want me to let you know when it's available.

Cheers, Declan.

InvexGames avatar Jun 01 '15 17:06 InvexGames

Hi, maybe you are calling the code too early, I used to get that problem because tried to run code inside OnEnable() method, after I've invoked my animation method inside OnEnable method with .1f units of delay, and everything worked perfectly. Hope that helps!

wilk3ns avatar Jul 09 '15 13:07 wilk3ns