- Home /
Unity Input Manager Not working for controller Vertical
I've gotten the controller working with input manager for everything except for this one function
public class PlatformController : MonoBehaviour { public float wait; // Update is called once per frame void Update() { if (Input.GetButtonDown("Vertical")) { StartCoroutine(FallTimer()); } IEnumerator FallTimer() { GetComponent<EdgeCollider2D>().enabled = false; yield return new WaitForSeconds(wait); GetComponent<EdgeCollider2D>().enabled = true; } } }
this is meant to disable a platform so the player can fall through it, it works with S and the Down arrow key but nothing happens on controller, again everything else works for my controller it just can't seem to register up or down on the vertical
here is a screenshot of my vertical input manager. any help would be appreciated
Answer by Nistroy · Jun 28, 2021 at 12:51 PM
Hello @The8BitShadow you must use Input.GetAxis ("Vertical") rather than Input.GetButtonDown if you want to move a gameObject, or if you just want to press the down or up arrow to make the GameObject deactivate use Input.GetKeyDown (KeyCode. S)