It’s great that we have manuals on how to override the great settings they made, but heavens forbid for them to put the important stuff in the manual, such as how to make a multiple frame action listener.
Great tool.
Anyone deciphered how to do it?
How is this:
…force the Input System to use my own template when the native backend discovers a specific Device?
In “…how do I?”
but “How do I make my object continuously move forward by holding down a button” isn’t ?
It’s the first time I am using the new Input system and I’ve been able to figure it on my own
Without using the Input Actions asset
using UnityEngine;
using UnityEngine.InputSystem;
public class MyMonoBehaviour : MonoBehaviour
{
// Define the action in the inspector
public InputAction inputAction;
private void OnEnable()
{
inputAction.Enable();
}
private void OnDisable()
{
inputAction.Disable();
}
private void Update()
{
transform.Translate( Vector3.forward * inputAction.ReadValue<float>() * Time.deltaTime );
}
}
Using the Input Actions asset (with C# generated class)
using UnityEngine;
using UnityEngine.InputSystem;
public class MyMonoBehaviour : MonoBehaviour
{
public Controls controls; // Rename the class here according to the class name you chose in the Input Action Importer
private void Awake()
{
controls = new Controls();
}
private void Update()
{
// You will also need to rename `Player` and `Move` according to the value you gave in the Actions
transform.Translate( Vector3.forward * controls.Player.Move.ReadValue<float>() * Time.deltaTime );
}
}
TLDR: @Rene-Damm: Yup, at the moment there’s no support for running logic continuously over time while a control is actuated so yup, it’d be up to OnFixedUpdate/OnUpdate and coroutines.