Jump to content

Need help making my character jump (C#) (Unity)

public class PlayerMovement : MonoBehaviour {
	public float speed = 900f;

	public Rigidbody2D Rgb;

	// Use this for initialization
	void Start () {
		Rgb = GetComponent<Rigidbody2D> ();
	}

	// Update is called once per frame
	void Update () {
		float Haxis = Input.GetAxis ("Horizontal") * speed * Time.deltaTime;

		Vector2 Move = new Vector2 (Haxis, 0);
		Rgb.velocity = (Move * speed);

	}
}

Okay so I've got the movement of my character sorted but despite everything i try i can't seem to make my character jump, any help will be appreciated :) . 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×