Open DezBoyle opened 3 years ago
Does this fix movement on stairs?
Hey! Just found that myself, wanted to post here, but been too late) Also, I'm having a bug with jumping. Still Can't figure it out. After first jump collider starts hovering above the ground slightly. With step offset turned on I can climb a step and collider sits normally, but if I then jump and land on that step - same hovering occures. Do you have any ideas, why?
Also, it seems crouching stops working after this fix. Or maybe I messed something up with my earlier changes.
Fixed crouching. Simplified code. SurfController.cs: this statement is unneccessary: if (_surfer.collider.GetType () == typeof (BoxCollider))
instead after 'else if (crouching)' use:
// Check if the player can uncrouch
bool canUncrouch = true;
Vector3 startPos = _surfer.moveData.origin;
Vector3 endPos = _surfer.moveData.origin + (uncrouchDown ? Vector3.down : Vector3.up) * heightDifference;
Trace trace = Tracer.TraceCollider(_surfer.collider, startPos, endPos, SurfPhysics.groundLayerMask);
if (trace.hitCollider != null)
canUncrouch = false;
I'm too lazy to fork this and fix it BUT I just figured out how to fix the capsule collider movement.
SurfPhysics.cs
public static void GetCapsulePoints (CapsuleCollider capc, Vector3 origin, out Vector3 p1, out Vector3 p2)
{
}
Removing - capc.radius fixes it.
Hopefully this helps someone.