Answer the question
In order to leave comments, you need to log in
How to stop a character in Unity2d?
When my character jumps forward, he keeps moving forward! How to make it so that after the jump the character remains on the point on which he landed?
private void Update()
{
if (isGrounded == true && Input.GetKeyUp(KeyCode.Space))
{
BallJump();
}
}
void BallJump() // прыжок вперед
{
Vector2 jjump = new Vector2(rb.velocity.x + speed, rb.velocity.y + jumpForce);
rb.AddForce(jjump, ForceMode2D.Impulse);
}
Answer the question
In order to leave comments, you need to log in
character velocity to 0 translate
rb.velocity = Vector3.zero, like this
or rb.velocity = new Vector3.zero
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question