Getting NullReference Exception

I am getting this error and an unable to track it down:
image

My MainMenu script is identical to what is in the lecture:
image

Clicking on “StartHostAsync” and pressing F12 takes me into HostGameManager:

I’ve added some debug.log(“Made it to Point #”) across the files. I make it to mainmenu/starthost(), but the failure seems to be ain the await HostSingleton line as I don’t make it to the try {allocation… line in HostGameManager.

I’ve gone through the videos twice and repeated the construction of these files.

It’s either the Instance or GameManager that is null. Make sure that you are calling CreateHost in ApplicationController and that the Instance is actually being set in HostSingleton

2 Likes

Yes, I agree, if you debug.log the Instance and the GameManager you may be able to narrow this down further.

OK, foolish mistake. I created a new HostGameManager object instead of using the GameManager method. All valid code so no syntax error, but still not putting the object in the correct namespace. Thanks for the assist. (commented line is what I had in originally)

image

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms