# Unity: Vertical Input will not return negative values

I am trying to make a 'single stick' shooter, where the character faces the direction they are moving, but I'm struggling to get the movement working correctly; no matter what I've tried, the player won't move down.

Through some investigation, the issue seems to be that hitting the s key does not return a negative Vertical axis value, and I don't know enough about the workings of the Input manager to understand why.

Here's the code, to check I haven't made a glaring mistake there:

public void FixedUpdate()
{
Controls();
}

...

public void Controls() {

if (gameStateManager.gameState == SingleStickShooter) {

// Variables
float xInput = Input.GetAxis($"{controller} Horizontal"); float yInput = Input.GetAxis($"{controller} Vertical");

Vector2 controlThrow = new Vector2(xInput, yInput);
print("Control Throw: " + controlThrow.x + " , " + controlThrow.y);

currentSpeed = runSpeed;

// Movement

Vector2 playerVelocity = controlThrow * currentSpeed;
rigidbody.velocity = playerVelocity;

print("Velocity: " + rigidbody.velocity.x + " , " + rigidbody.velocity.y);

// Rotation

float angle = Mathf.Atan2(yInput, xInput) * Mathf.Rad2Deg;
if (xInput != 0f || yInput != 0f)
transform.rotation = Quaternion.Euler(0f, 0f, angle);



I would love to go tinkering around in the Input Manager and learn through mistakes, but it's a collaborative project where other games using this system are working, so I don't want to risk breaking something by going in blind. Also, those games are successfully using the down key, but mine isn't which makes me think it's something else I'm too green to realise.

This is my first question so I don't know what else I should add, so let me know what other context you need and I'll add what I can.

EDIT: Below I've added the debugging info Ben Johnson requested. Console output returns over 1000 values due to being called in Update(); the section shown is specifically when I go from pressing right and up to right and down.

Gravity value for input manager is the only thing I can see that's different, but changing it doesn't seem to fix my problem. I thought that obviously having the vertical axis set to the Y-axis would be obvious too, but that also didn't help so I reverted to the one above it.

• Can you provide a screen shot of your input manager and what your print/Debug.Log() statements return? It would help to see what kind of data you are getting back from the input manager. Oct 4 '20 at 5:51
• Done; again the print() statements occur every frame there's player movement, so above is only a section where I'm trying to go in circles (i.e. changing from up to down) Oct 6 '20 at 4:27
• Might be because your vertical input is set to X axis instead of Y. It's probably returning your horizontal value or glitching. I know you tried it already but it looks like your y is almost always 0. Oct 6 '20 at 4:30
• Just came back from trying your suggestion, no dice. Also messed around with various options in the menu, changing the Type dropdown will rebind up/down in the menus to like my mouse or a connected controller, it always reverts to keys in game that do not work. I also tried rebinding down to other keys just in case that was doing something weird but that didn't change anything either. Oct 7 '20 at 5:03
• Not sure if you have this issue but most likely your best bet for outside help would be to make a copy of your project, delete everything except the script that debugs your controller values, create a simple test scene, and post it online. It's much easier to debug these kinds of input issues when you have direct access to the system. Also, just putting this out there, your Y gravity is 0 for some reason (x is 3), It's been a while since I used joysticks but that could also be an issue. Oct 14 '20 at 1:48