Forum rules - please read before posting.

Issue upgrading to Unity 6000.3

Hi Chris,
I’m currently using AC v1.82.1 with Unity 6000.2.7f2. I tried upgrading to Unity 6000.3.8f1 LTS, but encountered this error: Assets/AdventureCreator/Scripts/Animation/SpriteDirectionData.cs(25,4): error CS0592: Attribute 'SerializeField' is not valid on this declaration type. It is only valid on 'field' declarations.

Do I need to update AC to the latest version first, or is AC not compatible with Unity 6000.3? Also, could updating AC to the latest version cause any issues with my game?

Comments

  • You will need the latest AC release for compatibility with Unity 6.3, yes.

    You should always back your project up when upgrading both Unity and/or AC versions, or rely on version control, but the "Upgrade notes" section in the Changelog details any changes made to AC that may affect your game.

  • BikBik
    edited March 18

    I managed to update my AC to version 1.86.1. I ran into a few strange issues, like the hotspot icons becoming enormous and not sticking to the size I set for them. However, there’s one red error I couldn’t resolve, which is related to the player input system. This error only appears and keeps repeating, reaching 999+ when I test the game in the editor. It’s causing problems with the input system.

    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 /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:1063)
    UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/BindingsHelpers.cs:61)
    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)
    DialInputs.Custom_GetButtonDown (System.String input) (at Assets/DemonForest/InputSystem/Input System/Updated_ControlsReader.cs:59)
    AC.PlayerInput.InputGetButtonDown (System.String axis, System.Boolean showError) (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1987)
    AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:254)
    AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:188)

  • I’m not sure if you remember, but my input system has a custom script you wrote for me to enable the AC menu puzzle to support Up and Down inputs.

  • And here's the script(I'm still using Unity 6000.2.7f2):

    using UnityEngine;
    using AC;
    using AC.Downloads.InputSystemIntegration;
    
    public class DialInputs : ControlsReader
    {
    
        int axisDirection;
    
    
        void Update()
        {
            float axisValue = Custom_GetAxis("Vertical");
            if (axisValue > 1f)
            {
                if (axisDirection != 2)
                {
                    axisDirection = 1;
                }
            }
            else if (axisValue < -1f)
            {
                if (axisDirection != 2)
                {
                    axisDirection = -1;
                }
            }
            else
            {
                axisDirection = 0;
            }
        }
    
        protected override bool Custom_GetButtonDown (string input)
        {
            var element = KickStarter.playerMenus.MouseOverMenuElement;
            var menu = KickStarter.playerMenus.MouseOverMenu;
            if (menu != null && menu.IsOn () && element != null && menu.elements.Contains (element) && element.title.StartsWith("Dial"))
            {
                if (input == "InteractionB")
                {
                    if (axisDirection == -1)
                    {
                        axisDirection = 2;
                        return true;
                    }
                    return Custom_GetButtonDown("Down");
                }
                if (input == "InteractionA")
                {
                    if (axisDirection == 1)
                    {
                        axisDirection = 2;
                        return true;
                    }
                    return Custom_GetButtonDown("Up");
                }
            }
            return base.Custom_GetButtonDown (input);
        }
    
    }
    
  • edited March 19

    Did you upgrade Unity at the same time, or is updating AC the only change so far?

    Try replacing:

    using AC.Downloads.InputSystemIntegration;
    

    with:

    using AC.Templates.InputSystemIntegration;
    
  • Thank you, Chris. This fix has resolved the error. I really appreciate your help. I’ll continue testing the game to make sure there are no other issues, and then I’ll upgrade to Unity 6000.3, as I haven’t done that yet.

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.