- Home /
Input Axis names and axis type (help with joysticks)
Hey all,
The Scripting API/Unity Manual is rubbish here... any help: I want to understand the last three sections of the Input System project settings.
(probably the easiest!) How do the three types differ: KeyOrMouseButton, MouseMovement, JoystickAxis?
What are the many different Axes about? (X, Y, 3rd Axis (js + mouse), 4th Axis, 5th Axis, ...., 28th Axis)? The documentation only says "Choose the axis of input from the device (joystick, mouse, gamepad, etc.). Defaults to the X-axis.". And this isn't that helpful. My intuition is that for linear floats from -1 to 1, (possibly smoothed-out depending on gravity, snapping, sensitivity, and dead zone), you basically always use X axis - am I right?
How do I figure out what joystick my player will use (all?, 1, 2, ..., 16?)?
My use case right now is I'm trying to control two separate Transforms via the left and right joysticks on my Nintendo Switch Pro controller (basically the same shape as Xbox controllers). I would guess that left stick is Joystick1 and right stick is Joystick2. But that doesn't seem to work!
1)
$$anonymous$$eyOr$$anonymous$$ouseButton works like getkey();
$$anonymous$$ouse$$anonymous$$ovement is a standard for track mouse
JoystickAxis the keys of the joystick usually are processed as separated axis
so, why don't track directly the Input of each device (getkey() for keyboard, get$$anonymous$$ouseButtonDown() for mouse, get$$anonymous$$ouse$$anonymous$$ove()... etc) because we want some properties predefined and always used, like check dead zone, smooth transition, etc
2)
the axis are a virtual way to control "equilibrium" of a object, by example, you can control one axis with two keys (W to add positive S to add negative) so you just need to access that axis to check both (forward and backward movement) useful to control acceleration on a car-like game, isnt it?,
on the other hand, one device can control more than a axis, by example, mouse, mouse moves on a 2d plane, to check that unity uses left - right axis (left add negative, right positive) on $$anonymous$$ouse X, and a forward-backward axis on $$anonymous$$ouse Y...
Answer by nathan122 · Apr 20 at 07:30 PM
for number n3 you will have to search for a input axis sheet to find the names of the button layouts.
Your answer
Follow this Question
Related Questions
joystick connected 1 Answer
Controller input not working correctly 0 Answers
Analog stick control 1 Answer
Disable cinemachine free look camera movement when touch detected on mobile joystick 0 Answers