Hi everyone,
I have recently added AC's new input system integration package and wanted to ask about the workflow of adding a new action:
After adding a new action inside the controls asset, how do I get AC talking to this specific file?
Do I also need to reference these inputs in AC's ActiveInputs Editor?
And when I am trying to reference the action inside a C# script, is it better to use
KickStarter.playerInput.InputGetButton("HighlightHotspot")
Or would I create an InputActionReference and subscribe to this reference in OnEnable?
Sorry about the confusion, I think I'm mixing up two different workflows here.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
In what way is AC relying on this input? In an Active Input?
It should just be a case of naming the action the same as the "Input name" field, similar to the way the defaut actions are set up.
They should be identical. The only difference I can see is that the first method would still work if you later chose to remove Input System.
I'm not sure I follow exactly. The way I understand it, even if I create a new action via the new unity input system, I still need to add that to the active input editor, otherwise there is no way AC and the action can talk to each other - is that not correct?
It is - I'm just checking that it's an Active Input you're ultimately using.
In the case of Active Inputs, the "Input button" field, set to the name of the new Action, should be enough.
Right. In my case, I've added two new inputs to rotate game objects left and right. This is all done in a custom script.
Aha! So the standard way to set up an active input would be -> Create the action inside the new unity input system -> Create a corresponding active input with the same name -> reference that active input via Kickstarter.playerInput.GetButtonDown("ExampleInput")?
I'm not sure we're both referring to the same thing with the term "Active Input".
In AC, an Active Input is one listed in the Active Inputs Editor - in which an ActionList will run automatically when a given input is pressed. It is not referenced through script.
If you are just looking to reference an action you've added to your Input Actions asset, either referencing it as you have above - or with an InputActionReference variable - should work.
Thank you for clarifying.
So Active Inputs always run an ActionList, where as the regular inputs(?) I define via the new unity input system are used for C# scripting - and if I understand correctly, for these it doesn't make a huge difference whether I'm subscribing to an action list reference or check for my action via Kickstarter.playerInput, is that correct?
I suppose in this case Active Inputs are best used for Actions that can be entirely done via the ActionLists where no C# scripting is required?
If you meant "Input action reference", then yes - the key difference being that with playerInput you can just reference the input by name.
Right.
Thank you for clearing this up, Chris!