Forum rules - please read before posting.

NullReference after installation


It's about 4 times i'm creating a new project in version 2021.3.12f1 and i have the latest version of AC.

After the installation wizard, if i lauch the game i have errors like :

NullReferenceException: Object reference not set to an instance of an object
AC.PlayerCursor.DrawCursor () (at Assets/AdventureCreator/Scripts/Controls/PlayerCursor.cs:439)
AC.StateHandler._OnGUI () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:465)
AC.StateHandler.OnGUI () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:378)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

and also :
NullReferenceException: Object reference not set to an instance of an object
AC.AutoCorrectUIDimensions.ConvertToPlayableSpace (UnityEngine.Vector2 screenPosition) (at Assets/AdventureCreator/Scripts/Menu/AutoCorrectUIDimensions.cs:128)
AC.AutoCorrectUIDimensions.OnUpdatePlayableScreenArea () (at Assets/AdventureCreator/Scripts/Menu/AutoCorrectUIDimensions.cs:113)
AC.AutoCorrectUIDimensions+d__11.MoveNext () (at Assets/AdventureCreator/Scripts/Menu/AutoCorrectUIDimensions.cs:86)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <1d3dacd00ce441dc8c61d528a2193088>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

My game settings is set as :
movement : Point and click
Input method : Mouse and Keyboard
Interaction : Context Sensitive

Now if i put Keyboard or Controller i have :
NullReferenceException: Object reference not set to an instance of an object
AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:617)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:154)

I'm stuck in my development, i look at the 7 menus managers, they are all here.
I manage to do many things before in pass project but since yesterday, i'm stuck.
Can someone know what to do ?

Thank you,
Alex from France


  • Welcome to the community, @AlexInFrance.

    The errors above all suggest that it's a case of your scene not having an AC MainCamera present in your scene. There should be a separate warning message in your Console about this - is it not showing?

    Check that you have an object named MainCamera in your scene, both tagged as MainCamera and has AC's MainCamera component attached.

    The creation of this camera should be automated when using the Scene Manager to set up your scene. If it's missing, try clicking the "Without folders" button at the top of the Scene Manager - this will have AC re-add the MainCamera object if it can't be found.

    A tutorial on creating your first scene, following the creation of your game's Managers, can be found here.

  • Hello Chris,

    Thank you ! It works ! Thanks a lot !


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.