Hello, i'm really in need of your help. I installed the new iput system and also your Input System Template, following instructions but i have now a strange issue. All is working well if i start from the scene with player, but if i begin from "start menu" and then change scene, player won't move and unity will show this error:
MissingReferenceException: The object of type 'UnityEngine.InputSystem.PlayerInput' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at :0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at :0)
UnityEngine.Component.get_gameObject () (at :0)
UnityEngine.InputSystem.PlayerInput.get_actions () (at ./Library/PackageCache/com.unity.inputsystem@be6c4fd0abf5/InputSystem/Plugins/PlayerInput/PlayerInput.cs:328)
AC.Downloads.InputSystemIntegration.ControlsReader.GetInputAction (System.String axisName) (at Assets/AdventureCreator/Downloads/Input System integration/Scripts/ControlsReader.cs:370)
AC.Downloads.InputSystemIntegration.ControlsReader.Custom_GetButtonDown (System.String axisName) (at Assets/AdventureCreator/Downloads/Input System integration/Scripts/ControlsReader.cs:224)
AC.PlayerInput.InputGetButtonDown (System.String axis, System.Boolean showError) (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1987)
AC.Player._Update () (at Assets/AdventureCreator/Scripts/Character/Player.cs:149)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:304)
Tried everything but couldn't solve it. Many thanks for your help.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
What are your AC and Unity versions? The error lines suggest you're using the "Downloads" version of the Input System integration, whereas there's now an official one built-in to AC itself.
I'd recommend uninstalling this one and using the built-in one. Back up, then delete the /AdventureCreator/Downloads/InputSystem folder, as well as the Input System subfolder in your game's directory that the template generated.
In the Menu Manager, delete the "Inputs" menu, and clear the "Event system prefab" field. You should then be OK to re-install the integration via the built-in one using the New Game Wizard.
Chris, i wish to thank you once more. Your precious support is always the best.
Thanks for all!!
Now everything works great in unity, but when i export in apk touch events won't work...
"Touch events" as in specific touch inputs, or all touch input?
Try enabling Use Enhanced Touch Support in the EventSystem_InputSystem prefab the template generated.
In the Developer COnsole the error is "Enhanced touch api not enabled"
So i think this is the solution. i try just know and update you. Thanks
Error disappeared, but cannot touch on any of the start menu
Ok made some tests. Seems that only menu are affected. The player character in the scene is moving normally
All menus, or just this Start menu? What are your Menu's "Source" fields set to?
Do Unity's Player logs reveal any details?
Hi chris. All menus (Title menus, in game etc)
Source: Unity Ui Prefab
Unity gives only this error during Play in editor:
I think important to know:
I just made a test: New clean project, 2d, imported AC with only Input system and Title screen, opened title screen Scene and guess what? Both in simulator and in exported APK menu aren't clickable.
Recreated.
To fix, open up the Controls asset and move the Touch Screen's Press input from the UI/Submit Action to UI/Left Click.
tried fast in simulator and seems working!
Will try to export apk this evening, thanks