79709840

Date: 2025-07-22 03:32:50
Score: 1
Natty:
Report link

Sure! Here's a short and clear version:


You're seeing sliding and jittering because SAT gives you the smallest push direction, which isn’t always up. That makes the player slowly slide off slopes or flicker between grounded and not grounded.

✅ Quick Fixes:

  1. Use surface normals
    Check the angle of the surface you're on — if it's mostly flat (e.g., normal.y > 0.7), you're grounded.

  2. Stop gravity when grounded
    If grounded, skip applying gravity. Only re-enable gravity when you’re clearly off the ground.

  3. Stick to ground
    After collision, do a small downward raycast. If ground is right below, snap to it gently.

  4. Use a grounded timer
    Don’t toggle grounded every frame. Add a short delay (like 0.2s) before saying you're in the air.


This approach gives smoother movement and prevents sliding off small slopes.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Sowmya Posipogu