ADVERTISEMENT

Blocked | Slope Not

currentVelocity = Vector3.zero; // Natural stop, not a block

// No speed cap on slopes float slopeAccel = gravity * Mathf.Sin(slopeAngle * Mathf.Deg2Rad) * deltaTime; currentVelocity += slopeDirection * slopeAccel; slope not blocked

EnterSlide();

// Prevent micro-step blocking if (CheckForCollisionEdge(groundNormal, previousGroundNormal)) currentVelocity = Vector3

Vector3 smoothedNormal = LerpNormals(groundNormal, previousGroundNormal, 0.5f); ApplySmoothedVelocity(smoothedNormal); currentVelocity = Vector3.zero

// No artificial blocking even at low speed if (currentVelocity.magnitude < 0.01f && slopeAngle < maxWalkableAngle)