Forum rules - please read before posting.

NullReferenceException: Object reference not set to an instance of an object

I'm new to Adventure Creator and I've been following the AC first person tutorial on Youtube. This works perfectly fine, until I restart Unity and re-load the project. I no longer am able to playtest, as the following error messages appear:

Does anyone have an idea why this is happening?

Cheers!

Comments

  • Welcome to the comunity, @Law.

    Which version of AC are you using? It's listed at the bottom of your AC Game Editor window. Are any other messages showing besides these?

    It may be that you do not have a Settings Manager assigned. Each AC project needs its own set of Managers assigned in the AC Game Editor window.

    These Managers are created by the New Game Wizard - so if they've somehow become unset in the window, you should still be able to bring them back by assigning the assets manually.

    Check each tab within the AC Game Editor window, and if any of them are missing a Manager asset file, look for it in the Managers subfolder of the folder created when you used the New Game Wizard.

  • Thank you for the welcome, @ChrisIceBox !
    I appreciate your reply.

    I just checked and all manager asset files are assigned in all 8 windows. I did however notice that there's also a warning message on the console that always appears with the top two error messages:

    The PersistentEngine prefab is present in the Assets/AdventureCreator/Resources/ folder.

    I'm on:

    Unity 2020.2.1f1 (URP 10.2.2)
    AC 1.72.4

  • LawLaw
    edited January 2021

    A quick update; I tried placing the PersistentEngine prefab on the scene, and now it allows me to finally playtest the game (and it works well), but the following error message keeps appearing:

    So I checked the inspector of the PersistentEngine and unchecked the "Player Menus" script component from it, and now the error messages are gone and I can playtest without any issues, but I assume this isn't the correct way to get this working :smile:

  • edited January 2021

    No, indeed. The PersistentEngine shouldn't be part of any one scene - it needs to be scene-independent and should be spawned automatically.

    I'd expect that you won't be seeing any Menus, either, given the disabling of the PlayerMenus component.

    My apologies for the trouble. It's a strange issue - the prefab is named correctly, and in the correct folder - yet isn't being detected. This is all in a fresh project?

    One thing worth mentioning is that, as part of a performance drive, the next AC release will do away with the need for a PersistentEngine prefab - as AC will generate it from scratch automatically.

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.