0
\$\begingroup\$

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

\$\endgroup\$
1
\$\begingroup\$

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

float _jumpForce = 200;
charcter.GetComponent<Rigidbody2D>().AddForce(new Vector2(0,_jumpForce));
\$\endgroup\$
  • \$\begingroup\$ How to stop jumping in air? \$\endgroup\$ – user75648 Dec 18 '15 at 14:08
  • \$\begingroup\$ Do you have any script attached to ground? \$\endgroup\$ – Hamza Hasan Dec 18 '15 at 14:14
  • \$\begingroup\$ I dont have one \$\endgroup\$ – user75648 Dec 18 '15 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\$ – Hamza Hasan Dec 18 '15 at 14:17
  • \$\begingroup\$ Ok but before that, I would like to learn game programming from you. Do you have a website? \$\endgroup\$ – user75648 Dec 18 '15 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.