i have a problem with my project because my jump is slow:
if (Input.GetKeyDown(KeyCode.Space)) {
GetComponent ().velocity = new Vector2 (GetComponent ().velocity.y,alturaSalto);
}
how to make a jump ???
i have a problem with my project because my jump is slow:
if (Input.GetKeyDown(KeyCode.Space)) {
GetComponent ().velocity = new Vector2 (GetComponent ().velocity.y,alturaSalto);
}
how to make a jump ???
What number are you giving alturaSalto? If it is a low number then you need to give a higher number.
You could use AddForce
GetComponent<Rigidbody>().AddForce(new Vector2(0f, alturaSalto));
hi alturasalto is altitudeJump nad you line of code dont work
It does, you just need to set it a higher value. AddForce required a decent amount to make any noticeable change.