Forum rules - please read before posting.

PlayerInput error in play mode

Hi,

New to AC, trying to enter playmode I get this error:

NullReferenceException: Object reference not set to an instance of an object
AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:613)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:154)

I've setup the scene and character, I have Movement Method set to Direct, and Input method set to Keyboard or Controller.

I'm also using the prefab "ControlsReader" to use the new input system. Any ideas what's causing the error?

Unity 2021.3.9

Comments

  • Welcome to the community, @mantafanta77.

    If you're using the latest release, this error would appear if your scene is missing an AC MainCamera component. Though if this is so, you should be getting another error reporting that this is the case - are any other warnings appearing in the Console window?

    AC's MainCamera component should have been automatically added to your scene's MainCamera object when the Scene Manager was used to set the scene up for AC usage. If it's missing, you can add it manually via the "Add Component" menu in the Inspector - or click the buttons at the top of the Scene Manager to run the setup process again.

    If it's there and you're still getting the error, let me know your AC/Unity versions, and the full contents of the Console window and I'll try to see what's what.

  • oh thank you so much, that did fix it by clicking "organise scene with folders"

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.