- Home /
Question by
Serious_Shailesh · May 26, 2020 at 04:12 PM ·
colliderinput
Jump doesn't work while changing 2d colliders
I have a problem. I initially used a boxcollider2d and a circlecollider2d. But doing this resulted in registering multiple collisions sometimes. So I changed the colliders to be a single capsulecollider2d. And now my Jump doesn't work. Walk left or right works fine. Any help would be appreciated.
private void Movement()
{
if (Input.GetButtonDown("Jump") && coll.IsTouchingLayers(ground))
{
Jump();
}
}
private void Jump()
{
rb.velocity = new Vector2(rb.velocity.x, force);
state = State.jumping; // animation state
}
Comment