my code lets me move my rigid body move upward. it just jump in fixed position. but i want my rigid body to jump upward as well as move forward. how can i achieve. i tried addforce but nothing worked
`
if (isGrounded)
{
moveVector = transform.forward * jumpForwardheight;
if (jump)
{
anim.SetBool(“IsJump”, true);
Vector3 temp2 = rb.velocity;
temp2.y = jumpHeight;
rb.velocity = temp2;
}
if (!jump)
{
anim.SetBool("IsJump", false);
}
}`