how can i make my object can use rigidbody velocity on x axis and addforce on y axis, i want to move my character with velocity and make jump and gravity with addforce, i try :
vector3 forced = new vector3 (0, transform.position.y, 0);
myRb.AddForce(forced);
vector3 mov = new vector3 (transform.position.x, 0, 0);
myRb.velocity = (move * speed);
but it's not move like i want, how can i make velocity just on x axis, and addforce on y axis cause i want to make gravity and jump.
↧