So I’m extremely new to unity and my character jump works, however, the actual jump is just teleporting upward. How would I make this a fluid up and down motion rather than teleporting up and falling down with gravity?
Thanks!
{
public float speed;
public Rigidbody2D rb;
private float movement;
public float jump;
void Start()
{
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
rb.AddForce(new Vector2(rb.velocity.x, jump));
}
{
movement = Input.GetAxisRaw("Horizontal");
}
rb.velocity = new Vector2 (movement * speed, 0 * Time.deltaTime);
}
}