Character Controller strange gravity...

I have the following code in my update and I was wondering why my gravity is stronger when I walk of an edge then when I jump in the air. When I walk of, I fall down insanely fast, when I jump it feels like I’m on the moon. What did I do wrong?

		//Player movement
		float inputX = Input.GetAxis("L_StickX");
		
		if (controller.isGrounded){
			
			if (Input.GetButtonDown("A")){
				
				moveDirection.y = jumpSpeed;
				
				if (DebugPlayer == true){
					Debug.Log ("Player is Jumping");
				}
				
			}
			
		}
		
		moveDirection.x = inputX * speed;
		moveDirection = transform.TransformDirection(moveDirection);
		moveDirection.x *= speed;
        moveDirection.y -= gravity * Time.deltaTime;
        controller.Move(moveDirection * Time.deltaTime);

For now, the are the used values:

float speed = 12.0f;
float jumpSpeed = 200.0f;
float gravity = 200.0f;

And it’s a 2d platformer btw, that’s why I’m not changing the z axis.

The values don’t help since we don’t know how big everything is in your world. For example you need huge values for huge scaled objects. And an object with a scale of 1,1,1 can still be huge, depending.

Anyway your gravity is directly inverse of your jumpspeed so it is not suprising. Also don’t use deltatime in fixedupdate on physics.

A character has a height of 32.

What am I supposed to use instead of deltaTime?

How do other people solve this problem? I was going through this script:
http://www.unifycommunity.com/wiki/index.php?title=FPSWalkerEnhanced

It looks like he did the same as me, same goes for the info in the scripting reference. In bothe cases they use movementDirection.y for jumping and a negative value for gravity.

Does anyone know how to solve this?

You need to apply an equal but opposite vector to the gravity if your character wasn’t grounded and hadn’t jumped.