Forum rules - please read before posting.

New Input Integration Documentation + Error Inquiry

Hello,

I'm trying to convert an Adventure Creator (v1.85.5) project to use the new Unity (6000.2.9f1) input system (1.14.2). I've added the Input System package from package manager, changed the Project Settings for Player to use the new input system, restarted the editor, and I've modified the project with the "New Game wizard" / modify existing to import the "Input System integration".

First question: Is there any documentation for this anywhere? I'm having trouble finding resources to help facilitate the conversion, even with forum searches.

Second: I'm seeing a flood of errors after the conversion. I know it must be something simple, but I'm drawing a blank in my Scooby search. It appears to be coming from the PersistantEngine prefab's StateHandler scripting, which is using the old UnityEngine.Input. Is it currently a requirement to set the input support to "Both" in the Project Settings / Player?

InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
UnityEngine.Input.get_mousePosition () (at <c9c9036ab6444e9e909dcbf3f8b6ad93>:0)
AC.PlayerInput.InputMousePosition (System.Boolean _cursorIsLocked) (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1761)
AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:313)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:188)

I know that switching to "Both" does fix the error, but I'm stuck asking myself if that's the correct solution. Any guidance would be much appreciated!

Very respectfully,
Tyler

Comments

  • Another observation I've had is that we currently have a "SkipVideo" input mapped in the old input system (not in the Controls asset for the new system) that seems to still work, but I'd rather it not because I would prefer the new input system handle everything if it's possible.

  • Welcome back, @TogaMario!

    Unfortunately the bulk of the documentation for this was part of the Readme file that was included when the template was a separate download. I'll look to correct this, thanks for raising the issue.

    If you're getting the above error, however, then it looks like the integration isn't kicking in properly, because it'll override AC's default use of the Input class.

    It essentially works by overriding the Event System with its own prefab, which the installation should generate and assign at the top of the Menu Manager. Check that this is assigned - if it's become unset, you can find it in the "Input System" subfolder within your game's directory that the template created.

    It's important to note, though, that this will not spawn at runtime if there is already one present in the scene file. Though, AC will report this as a warning if it finds this to be the case.

  • Thank you for the warm welcome! And, ah ha! I had the previous EventSystem object/components in the scene already, so it wasn't spawning the prefab. Errors resolved and I confirmed that the Controls asset is now successfully handling my new "SkipVideo" binding. Thank you so much for the help there!

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.