hey guys i am making a simple game of a ball. So basically, i have a pc controller and i want to add to my game a contol that make the ball jump using my controller. how do i do that ?
this is the line code i am using if (Input.GetKeyDown(KeyCode.Space) && isFalling== false)
P.S: i want the to jump on my keyboard or on my controller
@saadbitar98 What you’re looking for is the InputManager. If you go to the Edit Menu, select Project Settings, then Input, the Inspector Panel will show the InputManager.
In the InputManager you can edit “groups” of inputs under various headings, one of which is called “Jump”. If you edit the “Jump” group to contain both the “space” key under positive button and, for example, “joystick button 0” under Alt Positive Button, then in your code instead of checking for the space key being pressed, you check for “Jump” being pressed, like this …
if (Input.ButtonDown("Jump") && isFalling == false){
… it will perform the content of the ‘if’ block when any of the inputs under the “Jump” group are activated.
Im getting a BCE0019 error:‘ButtonDoen’ is not a member of unityEngine.Input