New Actions not found in new Input System

Hello! Currently I am getting an error stating :

In my case, PlayerControlsAsset is the new Input Action Asset, and the Weapon Actions is the weapon folder.
7831044--991839--upload_2022-1-22_12-40-24.png
The error is only appearing on the new ADS Action, not on the others.

Here is the line of code :

private bool isAiming;
public PlayerControlsAsset controls;


    // Initiation \\
    private void OnEnable()
    {
        controls.Enable();
    }

    private void OnDisable()
    {
        controls.Disable();
    }

    private void Awake()
    {
        controls = new PlayerControlsAsset();

        controls.Weapon.ADS1.performed += _ => isAiming = true;

        controls.Weapon.ADS1.canceled += _ => isAiming = false;

    }

Also this is my first post, some advice for the future are always welcome. Thanks

you get more help if you post it here Unity Engine - Unity Discussions
edited wrong forum address : Unity Engine - Unity Discussions

i look at your code and assuming you drag and srop input asset into the PlayerControlsAsset controls slot

but on Awake you replace it with the new create one so the original asset is no longer referance there for ADS1. cant be found

I actually haven’t referenced the PlayerControlsAsset in the inspector, because it isn’t there ( not visible in inspector). But I am pretty sure that I don’t have to since all the other actions are working fine. I’ll try doing that.

Yeah it still doesn’t work. I will look into it later.

you had generate the c# class right. and you asset did it has auto-save on?, you can open PlayerControlsAsset script and check if “ADS1” also in there with the right name and everything

I’ve regenerated the project files, but haven’t checked if ADS is there. I’ll look into it

Yeah so It’s working now for some reason. I haven’t really done anything specific. It got fixed on it’s own. But yeah thanks for the help

1 Like

Hello i am getting this problem aswell, has anyone found a solution for this? I have basically identical code and all my other inputs are working aswell, just for one week i haven´t been able to add new Inputs.

If anyone lands on this, I fixed it the issue by making sure that in all my scenes I had the Event System and Input System UI Input Module set correctly:

I was having the issue because one of my scene had the wrong (default) Actions Asset set.