Hi, so I’m working on a game now, and I’ve recently tried to put alternate controls into my game that aren’t keyboard presses. However, this has caused issues on my part, since it’s the first time I’ve tried this.
Here are the bools I want to activate in the Input System:
public bool moveUp;
public bool moveDown;
public bool moveLeft;
public bool moveRight;
public bool shoot;
public bool charge;
public bool change;
public bool reversechange;
Said bools are part of a script that controls the player character, but without knowing how to make it so the Input System activates said bools, it won’t work.
How can I make it so the Input Action Asset I have is connected to the bools in the code, if I can do it at all?
Alright, and would I need to make different button commands for certain actions? (For instance, for a shooting action, it would be J on a keyboard and would be the cross button on a Playstation controller)
Don’t get hung up on particulars like “the joystick…” all input is ultimately just numbers and booleans.
Whatever “the joystick” is, go directly to the documentation and read how to get values from it and make decisions based on it. Learn what the actual numbers mean.
Perhaps the term CurrentJoystickValue.x < -0.2f means left.
Perhaps the term Input.GetAxis("Horizontal") < -0.25f means left.
Perhaps the term Input.GetKeyDown( KeyCode.LeftArrow) means left.
Perhaps the term Input.mousePosition.x < 100 means left.
Stack them on one at a time and PROVE each one works with Debug.Log().
However many channels of input (up, down, left, right, fire, jump, crouch, aim down sights, use) you have, that’s how much inputs you need to implement, obviously.