Im using pretty basic code here

charcter.transform.Translate(Vector2.up * speed * Time.deltaTime);

Im using rigidbody 2d and I'm creating a platformer. When i press the button the character transforms very little in y axis.

Rigidbody Data


1 Answer 1


Why are you not using Physics when you have rigidbody? Try

float _jumpForce = 200;
charcter.GetComponent<Rigidbody2D>().AddForce(new Vector2(0,_jumpForce));
  • \$\begingroup\$ How to stop jumping in air? \$\endgroup\$
    – user75648
    Commented Dec 18, 2015 at 14:08
  • \$\begingroup\$ Do you have any script attached to ground? \$\endgroup\$ Commented Dec 18, 2015 at 14:14
  • \$\begingroup\$ I dont have one \$\endgroup\$
    – user75648
    Commented Dec 18, 2015 at 14:15
  • \$\begingroup\$ Ok, so do me a favour, either edit your question or ask another question for this, because it will look irrelevant if I edit the same answer \$\endgroup\$ Commented Dec 18, 2015 at 14:17
  • \$\begingroup\$ Ok but before that, I would like to learn game programming from you. Do you have a website? \$\endgroup\$
    – user75648
    Commented Dec 18, 2015 at 14:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .