Skip to content

Commit a0a3b22

Browse files
fix: canSleep to true by default
1 parent 419874a commit a0a3b22

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ecctrl",
3-
"version": "1.0.39",
3+
"version": "1.0.40",
44
"author": "Erdong Chen",
55
"license": "MIT",
66
"description": "A floating rigibody character controller for R3F",

src/Ecctrl.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ const Ecctrl = forwardRef<RapierRigidBody, EcctrlProps>(({
577577
y: currentPos.y + moveImpulsePointY,
578578
z: currentPos.z,
579579
},
580-
false
580+
true
581581
);
582582
};
583583

@@ -760,7 +760,7 @@ const Ecctrl = forwardRef<RapierRigidBody, EcctrlProps>(({
760760
.set(0, (run ? sprintJumpMult * jumpVel : jumpVel) * slopJumpMult, 0)
761761
.projectOnVector(actualSlopeNormalVec)
762762
.add(jumpVelocityVec),
763-
false
763+
true
764764
);
765765
// Apply jump force downward to the standing platform
766766
characterMassForce.y *= jumpForceToGroundMult;
@@ -989,7 +989,7 @@ const Ecctrl = forwardRef<RapierRigidBody, EcctrlProps>(({
989989
0,
990990
(movingObjectVelocity.z - currentVel.z) * dragDampingC * 2
991991
);
992-
characterRef.current.applyImpulse(dragForce, false);
992+
characterRef.current.applyImpulse(dragForce, true);
993993
}
994994
}
995995

@@ -1035,7 +1035,6 @@ const Ecctrl = forwardRef<RapierRigidBody, EcctrlProps>(({
10351035
return (
10361036
<RigidBody
10371037
colliders={false}
1038-
canSleep={false}
10391038
ref={characterRef}
10401039
position={props.position || [0, 5, 0]}
10411040
friction={props.friction || -0.5}

0 commit comments

Comments
 (0)