Character controller Joystick issues.

Hi, I was using a custom script for my character and physics, but decided to start over and build my own.

The other script was not using a character controller, but now I am. I’m having issues getting the physics and input settings to behave correctly on my x360 PC controller I’ve been using. When I move the character, then let go of the joystick, the character stops moving instantly which is very unrealistic. Altering the input settings such as gravity/sensitivity have undesired effects (such as permanent sliding or making the character violently fly off in one direction). Using the keyboard works just fine, I can set the values to behave correctly. I don’t think my x360 controller is to blame as it was working well before.

I’ve been putting this issue off for awhile… any ideas what may be wrong here? Thanks!

I’m guessing somewhere in your script you have:

if(Input.GetAxis("Horizontal") != 0){
     movement.x = Input.GetAxis("Horizontal") * speed;
}else{
     movement.x = 0;
}

You’ll want it to read more like so:

    if(Input.GetAxis("Horizontal") != 0){
         movement.x = Input.GetAxis("Horizontal") * speed;
    }else{
         if(movement.x > 0.1){
              movement.x *= drag;
         }else{
              movement.x = 0;
         }
    }