Search Unity

Feedback Assets/Controls.cs(9,25): error CS0246: The type or namespace name 'InputActionAssetReference' could

Discussion in 'Input System' started by ElnuDev, May 5, 2019.

  1. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    I'm using Unity 2019.1.1f1 alongside Input System 0.2.8, which I just upgraded to from 0.2.1. When creating the generated class
    Controls.cs
    from
    Controls.inputactions
    , I got the following error:

    Assets/Controls.cs(9,25): error CS0246: The type or namespace name 'InputActionAssetReference' could not be found (are you missing a using directive or an assembly reference?)


    Any ideas on how to fix this? Thanks in advance!
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    The Input System no longer uses `InputActionAssetReference`s to which you need to assign the asset for the generated wrapper code - instead it will now embed the asset data into the wrapper code itself. That way, we save the step of having to manually assign the reference. Now, your Controls.cs is still using the old style. Try deleting and regenerating it.
     
  3. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    That doesn't work on its own. Even after updating to 0.2.8, deleting
    Controls
    file and regenerating it, the file would still be created in the old way.
    As tiskolin found out in his other thread, you also need to restart Unity after updating. Then it works.
     
    ElnuDev likes this.