In the next project, Argon Assault, we’re introduced to CrossPlatformInputManager. It might be what you’re looking for. You can use it to define any arbitrary axis, which you can then treat as either an analog or digital interface. For example, I’ve used it to setup my shoulder buttons for aileron rolls in Argon Assault, treating them as digital inputs by using the digital interface on it, using the label I defined:
private void PollRolls()
{
if (!alive || rollDirection != 0) return;
if (CrossPlatformInputManager.GetButton("RollLeft")) rollDirection = 1;
if (CrossPlatformInputManager.GetButton("RollRight")) rollDirection = -1;
}
So when I call it a digital interface, I mean that it will return either true or false, 1 or 0, but you can also use the ramp and falloff to simulate an analog axis through what I’m calling the analog interface, i.e. CrossPlatformInputManager.GetAxis(“RollLeft”) would return a number very close to zero (but not quite) in the first frame it was pressed, ramping-up to 1 over the ramp time, frame by frame; this might be a better way to apply a force, because it will lerp itself, giving a smoother roll-on and roll-off of force (which are easy to tweak by messing with the ramp and falloff values, called “sensitivity” and “gravity” in Edit… Project Settings > Input…