After analyzing the compiled build of CP12 FinalProj and obtaining the actual source code, we traced a recurring player complaint to a single block of code in playerMovement.cs: the gravity modifier section that was causing the character to stick to the ground on landing after high jumps. Here is the exact before-and-after comparison.

The Problem

When performing a high jump, the player would sometimes land and be unable to move horizontally until jumping again. Two things were happening simultaneously:

  1. The gravity modifier was fighting the ground. On the exact frame the physics engine detected the landing (isGrounded = true), the script was still applying extra downward force from fallMultiplier, pushing the character into the floor collider and creating a pinning effect.
  2. Horizontal velocity was being wiped on every frame. The movement code overwrote horizontal speed regardless of input, so letting go of keys meant instant zero-velocity — no coasting, no momentum carry-over.

The first issue was the primary culprit. The second added to the "stuck" feeling but was left as-is after testing showed the ground-gate fix resolved 90% of the problem.

BEFORE: Unconditional Gravity Modifiers (Lines 213-221)

//this section makes jumping while holding the key go higher vs tapping which leads to the lowjumpmultiplier
if (rb.linearVelocity.y < 0)
{
    rb.linearVelocity += Vector2.up * Physics2D.gravity.y * (fallMultiplier - 1) * Time.deltaTime;
}

else if (rb.linearVelocity.y > 0 && !Input.GetKey(KeyCode.Space) && !Input.GetKey(KeyCode.W) && !Input.GetKey(KeyCode.UpArrow))
    
    rb.linearVelocity += Vector2.up * Physics2D.gravity.y * (lowJumpMultiplier - 1) * Time.deltaTime;

What was wrong: This block ran every single frame, regardless of whether the player was on the ground or not. When falling fast (rb.linearVelocity.y < 0) and landing, the fall multiplier kept pushing down into the floor collider for as long as vertical velocity remained negative — which meant every frame until a jump reset it. The physics solver had to fight that extra force continuously, creating the sticky sensation.

AFTER: Ground-Gated Gravity Modifiers

//this section makes jumping while holding the key go higher vs tapping which leads to the lowjumpmultiplier
if (!isGrounded) {
    if (rb.linearVelocity.y < 0)
    {
        rb.linearVelocity += Vector2.up * Physics2D.gravity.y * (fallMultiplier - 1) * Time.deltaTime;
    }

    else if (rb.linearVelocity.y > 0 && !Input.GetKey(KeyCode.Space) && !Input.GetKey(KeyCode.W) && !Input.GetKey(KeyCode.UpArrow))
        
            rb.linearVelocity += Vector2.up * Physics2D.gravity.y * (lowJumpMultiplier - 1) * Time.deltaTime;
}

What changed: A single guard — if (!isGrounded) — wraps the entire block. When the player is on the ground, Unity's physics engine handles contact normally without any interference from these modifiers. The fall multiplier no longer fights the floor collider. Horizontal movement resumes instantly after landing because nothing is actively pinning the character in place.

Why It Works

The gravity modifiers exist for a reason: making falls feel snappy (fallMultiplier = 2.5f) and letting players control jump height by holding or tapping (lowJumpMultiplier = 4). These are classic platformer techniques that improve game feel significantly.

The problem was not the modifiers themselves — it was their timing. They needed to run only while airborne. By checking !isGrounded first, we create a simple gate: in the air, the modifiers apply as designed; on the ground, they stay out of the way entirely. The physics engine then resolves collisions and contact naturally, with no extra forces pushing the player into surfaces.

Notes

A deceleration-based friction fix was also written (replacing the instant-velocity overwrite with Mathf.MoveTowards() to allow gradual stopping when keys are released), but was reverted after testing. The ground-gate fix alone resolved the primary complaint, and further changes were deferred until additional playtesting confirmed what else needed adjustment.