Skip to content

Commit bc0c4cf

Browse files
fix: always awake when point to move
1 parent e6e9ff1 commit bc0c4cf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
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.53",
3+
"version": "1.0.56",
44
"author": "Erdong Chen",
55
"license": "MIT",
66
"description": "A floating rigibody character controller for R3F",

src/Ecctrl.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ const Ecctrl = forwardRef<RapierRigidBody, EcctrlProps>(({
682682
);
683683

684684
// Apply balance torque impulse
685-
characterRef.current.applyTorqueImpulse(dragAngForce, false)
685+
characterRef.current.applyTorqueImpulse(dragAngForce, mode === "PointToMove" ? true : false)
686686
};
687687

688688
/**
@@ -708,11 +708,11 @@ const Ecctrl = forwardRef<RapierRigidBody, EcctrlProps>(({
708708
crossVector.crossVectors(pointToPoint, vectorZ)
709709
// Rotate character to moving direction
710710
modelEuler.y = (crossVector.y > 0 ? -1 : 1) * pointToPoint.angleTo(vectorZ);
711-
// Once character close to the target point (distance<0.5),
711+
// Once character close to the target point (distance<0.3),
712712
// Or character close to the wall (bodySensor intersects)
713713
// stop moving
714714
if (characterRef.current) {
715-
if (pointToPoint.length() > 0.5 && !isBodyHitWall) {
715+
if (pointToPoint.length() > 0.3 && !isBodyHitWall) {
716716
moveCharacter(delta, false, slopeAngle, movingObjectVelocity)
717717
isPointMoving = true
718718
} else {

0 commit comments

Comments
 (0)