Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Input System parameters are limited to primitive types

Discussion in 'Input System' started by detzt, Sep 12, 2023.

  1. detzt

    detzt

    Joined:
    Oct 6, 2018
    Posts:
    23
    When extending the InputSystem with custom Interactions, Composites, or Processors, it seems like I can only use primitive types like bool, float, etc as parameters. Even the most basic types like Vector3 cannot be used, throwing exceptions to the console. Writing a custom Editor does not solve the issue.
    Also attributes like Range are completely ignored, i.e. a float field does not show up as a slider when decorated with
    [Range(0f, 1f)]
    .
    Why is this severely limited compared to the Inspector?
    Or, if it should work like that, what am I doing wrong?

    ArgumentException: Don't know how to convert PrimitiveValue to 'Object'
    Parameter name: type
    UnityEngine.InputSystem.Utilities.PrimitiveValue.ConvertTo (System.TypeCode type) (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Utilities/PrimitiveValue.cs:229)
    UnityEngine.InputSystem.Utilities.NamedValue.ConvertTo (System.TypeCode type) (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Utilities/NamedValue.cs:28)
    UnityEngine.InputSystem.Editor.Lists.ParameterListView.Initialize (System.Type registeredType, UnityEngine.InputSystem.Utilities.ReadOnlyArray`1[TValue] existingParameters) (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Editor/AssetEditor/ParameterListView.cs:148)
    UnityEngine.InputSystem.Editor.InputBindingPropertiesView.InitializeCompositeProperties () (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs:197)
    UnityEngine.InputSystem.Editor.InputBindingPropertiesView.DrawGeneralProperties () (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs:72)
    UnityEngine.InputSystem.Editor.PropertiesViewBase.DrawGeneralGroup () (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:59)
    UnityEngine.InputSystem.Editor.PropertiesViewBase.OnGUI () (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:39)
    UnityEngine.InputSystem.Editor.InputActionEditorWindow.DrawPropertiesColumn (System.Single width) (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:733)
    UnityEngine.InputSystem.Editor.InputActionEditorWindow.OnGUI () (at ./Library/PackageCache/com.unity.inputsystem@1.6.3/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:668)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <3b2d692d4eed47e39c173900baee3ade>:0)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <3b2d692d4eed47e39c173900baee3ade>:0)
    UnityEditor.DockArea.OldOnGUI () (at <3b2d692d4eed47e39c173900baee3ade>:0)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <915ee440ff24469bb17649a0923b67bf>:0)
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
     
    Last edited: Sep 12, 2023