# Problem of gravity

Good afternoon,

I am currently developing ,me only, a 2d platformer video game,

I use as player , cat asset bought with it animations on spriter pro steam and then transferred with the spriter pro tool to unity ,

This player (cat asset spriter pro) measures on unity 2 meters . 56 cm approximately (2 units . 56) in length includes these ears (I use several polygons collider for each parts of the cat body assembled afterwards with a composite collider with automatic mass , density equal 1 and no physic material 2d),

from the beginning of the development of my project, I always encounter a problem of gravity and acceleration of gravity which influence in an wrong level design and the other parameters of controller movement like jump force value, move force value and run force value ,

and the jump curve was always in the shape of a triangle acute , even with low gravity , with any value of move or run force,

and the jump or fall had a gravity too slight,regardless of the length of the fall,

I asked also before this question on the forum (see this link)

and I had an answer, it partially corrected these problems, but not completely,

after this topic and acutally, the jump curve is correct (half circle) with some values ​​of move force for each value of gravity,

but the problem is that I attribute the gravity value very roughly without any precision or logic behind,

with initial gravity on y value between -50 and -100 and is always incorrect

(not satisfied with these values ​​because the fall is always slightly slow and not fast as desired despite these abnormally high gravity values)

and with move force which becomes more fast than necessary for these values ​​of gravity to keep the shape of semi-circular jump curve,

not to mention the acceleration of gravity which is low and slow for short falls like the simple jump and on the contrary too fast for a large (the greater the fall, the faster the speed of gravity increases) even for a gravity value of only 15,

otherwise I also noticed that there are no great differences between gravity value of 15 and 100 for the jump,

(all these parameters such as gravity, move force, jump force, run force are apparently linked and the variation of one will affect the others)

here is a part of the source code of the project (that of jumping and moving),

`````` void FixedUpdate ()
{
if ((!Input.GetKey (KeyCode.RightArrow) && !Input.GetKey (KeyCode.LeftArrow)) && Input.GetAxis ("L_XAxis_1") == 0 && Input.GetAxis ("DPad_XAxis_1") == 0) {
h = 0;
rigidBody.velocity = (new Vector2 (h, rigidBody.velocity.y));
wait = true;
anim.SetFloat ("speed", 0f);
} else if (!Input.GetKey (modes.boutonX) && !Input.GetKey (KeyCode.Joystick1Button1)) {
if (Input.GetKey (KeyCode.RightArrow) || Input.GetAxis ("L_XAxis_1") > 0 || Input.GetAxis ("DPad_XAxis_1") > 0) {
h = 1;
anim.SetFloat ("speed", 1f);
}
if (Input.GetKey (KeyCode.LeftArrow) || Input.GetAxis ("L_XAxis_1") < 0 || Input.GetAxis ("DPad_XAxis_1") < 0) {
h = -1;
anim.SetFloat ("speed", 1f);
}
wait = false;
rigidBody.velocity = (new Vector2 (h * moveForce, rigidBody.velocity.y));
anim.SetBool ("X", false);
} else if (Input.GetKey (modes.boutonX) || Input.GetKey (KeyCode.Joystick1Button1)) {
if (!toJump) {
if (Input.GetKey (KeyCode.RightArrow) || Input.GetAxis ("L_XAxis_1") > 0 || Input.GetAxis ("DPad_XAxis_1") > 0) {
h = 1;
anim.SetFloat ("speed", 1f);
}
if (Input.GetKey (KeyCode.LeftArrow) || Input.GetAxis ("L_XAxis_1") < 0 || Input.GetAxis ("DPad_XAxis_1") < 0) {
h = -1;
anim.SetFloat ("speed", 1f);
}
wait = false;
rigidBody.velocity = (new Vector2 (h * maxSpeed, rigidBody.velocity.y));
anim.SetBool ("X", true);
}
}
Jump ();
}
void Jump ()
{
if (Input.GetKeyDown (modes.spaceButton) || (Input.GetAxisRaw ("Jump") > 0 && jump)) {
if (jumpOk) {
if (jumpNumber >= 0) {
jumpNumber--;
up = true;
toJump = true;
rigidBody.velocity = new Vector2 (rigidBody.velocity.x, jumpForce);
jump = false;
}
}
}
if (Input.GetAxisRaw ("Jump") == 0 && !Input.GetKeyDown (modes.spaceButton)) {
jump = true;
}
}
``````

how to correct completely this problem please and what are all the exact values ​​for my character (move force, force force, jump force, gravity value, density, mass etc)   ?.

Thank you very much ,

Cordially .