00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Edits to post #26754852 by Frenchie14

Edited

I'm adding a new game to Newgrounds with medals. I've done this before about a year ago with no issues. Now all of a sudden I was getting exceptions in the editor:

NullReferenceException: Object reference not set to an instance of an object
io.newgrounds.core._createCall (System.String component, System.Object parameters, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:296)
io.newgrounds.core.callComponent (System.String component, System.Object parameters, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:317)
io.newgrounds.components.Medal.unlock.callWith (io.newgrounds.core core, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/components/Medal.cs:94)
GameManager.NgProcessMedalQueue () (at Assets/Scripts/GameManager.cs:358)
GameManager.NgOnReady () (at Assets/Scripts/GameManager.cs:342)
io.newgrounds.core.onReady (System.Action callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:74)
GameManager.NgRegisterAPI () (at Assets/Scripts/GameManager.cs:336)
GameManager.Start () (at Assets/Scripts/GameManager.cs:97)


I also hit an error when previewing the game on Newgrounds:

"Unable to cast object of type 'ResultModel' to type 'unlock'."


I already have medal unlocks sit in a queue until NG.IO reports ready.


Turns out there was a recent change to NG.IO which is incompatible with how I was using it:

https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c/pull-requests/1


core.cs changed from `Start()` to `Awake()`


I don't use NG.IO in the way recommended by the guide. Rather than creating an object in my scene editor with the required properties, I create a new object at the start of the game and fill in the properties. This way, I can initialize it at runtime only if I'm exporting a build for Newgrounds (vs some other site or standalone). For some reason, the change to `core.cs` makes this no longer work.


FYI for anyone who hits this error in the future. Solution in my case was just to switch core.cs back to Start()


I'm adding a new Unity3D game to Newgrounds with medals. I've done this before about a year ago with no issues. Now all of a sudden I was getting exceptions in the editor:

NullReferenceException: Object reference not set to an instance of an object
io.newgrounds.core._createCall (System.String component, System.Object parameters, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:296)
io.newgrounds.core.callComponent (System.String component, System.Object parameters, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:317)
io.newgrounds.components.Medal.unlock.callWith (io.newgrounds.core core, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/components/Medal.cs:94)
GameManager.NgProcessMedalQueue () (at Assets/Scripts/GameManager.cs:358)
GameManager.NgOnReady () (at Assets/Scripts/GameManager.cs:342)
io.newgrounds.core.onReady (System.Action callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:74)
GameManager.NgRegisterAPI () (at Assets/Scripts/GameManager.cs:336)
GameManager.Start () (at Assets/Scripts/GameManager.cs:97)


I also hit an error when previewing the game on Newgrounds:

"Unable to cast object of type 'ResultModel' to type 'unlock'."


I already have medal unlocks sit in a queue until NG.IO reports ready.


Turns out there was a recent change to NG.IO which is incompatible with how I was using it:

https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c/pull-requests/1


core.cs changed from `Start()` to `Awake()`


I don't use NG.IO in the way recommended by the guide. Rather than creating an object in my scene editor with the required properties, I create a new object at the start of the game and fill in the properties. This way, I can initialize it at runtime only if I'm exporting a build for Newgrounds (vs some other site or standalone). For some reason, the change to `core.cs` makes this no longer work.


FYI for anyone who hits this error in the future. Solution in my case was just to switch core.cs back to Start()