New answers tagged jumping
0
The @DMGregory's comment is what I was looking for.
I just take the character colliders and run for each one of them the call:
foreach(var characterPartCollider in characterPartsColliders)
{
Physics2D.IgnoreCollision(groundCollider, characterPartCollider);
}
This makes the character fall down through a platform. Then when I detect a collision with ...
0
Solved it by checking if the button is up AND the y velocity is more than zero. Basically the velocity code will not be executed when the character is falling. Here is the code snippet:
if (Input.GetButtonUp("Jump") && rb.velocity.y > 0)
{
isJumping = false;
rb.velocity = new Vector2(rb.velocity.x, 0f);
}
Top 50 recent answers are included
Related Tags
jumping × 110unity × 48
c# × 29
physics × 28
platformer × 16
2d × 15
java × 11
movement × 10
collision-detection × 9
libgdx × 9
animation × 8
box2d × 5
input × 5
android × 4
javascript × 4
godot × 4
rigidbody × 4
control × 4
c++ × 3
mathematics × 3
sprites × 3
game-maker × 3
raycasting × 3
touch × 3
xna × 2