Forum rules - please read before posting.

Update causing problems.

As per usual I've updated AC and my game is broken. Is there a better way than clicking update in the Asset Store download window because going through this every time makes me not want to update.

When I run the game I get this error:

NullReferenceException: Object reference not set to an instance of an object
AC.RuntimeInventory.SetNull () (at Assets/AdventureCreator/Scripts/Inventory/RuntimeInventory.cs:105)
AC.RuntimeInventory.OnStart () (at Assets/AdventureCreator/Scripts/Inventory/RuntimeInventory.cs:69)
AC.StateHandler.InitPersistentEngine () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:82)
AC.StateHandler.OnAwake () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:69)
AC.KickStarter.SetPersistentEngine () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:107)
AC.KickStarter.AssignLocalPlayer () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1160)
AC.KickStarter.OnAwake () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:913)
AC.MultiSceneChecker.Awake () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:30)

The game pauses and allows me to unpause it and it runs but nothing works, the character just animates in his default state and I can't click on anything. It doesn't play the intro cutscene or anything. 

Comments

  • I apologise for your trouble.  The error is caused by your GameEngine prefab not having an EventManager component on it.

    As the v1.51 upgrade notes explain, the GameEngine and PersistentEngine prefabs have been updated, and must be re-imported.  Importing only the Scripts folder, which may be what has happened, is not enough.
  • I imported the whole Adventure Creator project, except for the Demos. I then tried again importing everything but the 2D Demo but still no luck. Do I need to import that? 

    I have missed a few previous updates so will have jumped ahead on this update. That wouldn't make a difference would it? 

    Is there a chance unity thinks these files haven't changed so isn't replacing them with new ones?
  • Also I just checked and the GameEngine prefab does have an EventManager on it. 
  • edited May 2016
    Each update comes with an "Upgrade notes" section (see the changelog.txt) that lists any changes you need to be aware of when upgrading.  Be sure to read this section for each update you've skipped, as well as the most recent.

    If you have the EventManager on your GameEngine, I'm confused as to how
    the error could appear.  Though it's on the prefab, is it also on the local instance in your scene?

    I would recommend testing your AC by importing it into a fresh project and running the demo game.  It would actually be safe to comment the line the error refers to (line 104 of RuntimeInventory.cs), but you may find it simply gets replaced with another.
  • I replaced the prefab in my scene with the one from the project folder and now it works. Thanks. 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.