#Character stays airbourne after landing

1 messages · Page 1 of 1 (latest)

autumn void
#

I am having an issue with vertical collisions. I am hoping somebody can help me out. I think I am having trouble wrapping my head around what I actually want to happen.

#

My surfaces are one continous object merged from a composite tilemap.

#

I set this up that way because she kept bumping on flat geometry as she walked.

autumn void
#

Oh hey, now adding the buffer does what I want it to do. I just need to disable input temporarily so that she can't bump into again.

#

SuccubusInput.cs


HandleCollision(Collision2D collission, CollisionType collisionType)
{
    ...
        else if (Airbourne() &&
            collision.collider.CompareTag(Tag.Platform) &&
            collision.contactCount > 0 &&
            SurfaceIsVertical(collision)
        )
        {
            Vector3 localPosition = player.Transform().localPosition;
            player.Transform().localPosition = new Vector3(
                localPosition.x - 0.01f,
                localPosition.y,
                localPosition.z
            );
        }
    ...
}