Skip to content

Commit b4cb94f

Browse files
committed
Make strafe move in the right direction after camera changes
1 parent 585fe2f commit b4cb94f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

api/movement.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ export const flockMovement = {
104104
appliedHorizontalVelocity = desiredHorizontalVelocity;
105105
} else {
106106
// airborne: no acceleration toward input, apply drag
107-
appliedHorizontalVelocity = currentHorizontalVelocity.scale(airDragPerTick);
107+
appliedHorizontalVelocity =
108+
currentHorizontalVelocity.scale(airDragPerTick);
108109
if (airControlFactor > 0) {
109110
appliedHorizontalVelocity = appliedHorizontalVelocity.add(
110111
desiredHorizontalVelocity.scale(airControlFactor),
@@ -281,7 +282,7 @@ export const flockMovement = {
281282
const model = flock.scene.getMeshByName(modelName);
282283
if (!model || speed === 0) return;
283284

284-
const sidewaysSpeed = speed;
285+
const sidewaysSpeed = -speed;
285286

286287
// Get the camera's right direction vector (perpendicular to the forward direction)
287288
const cameraRight = flock.scene.activeCamera

0 commit comments

Comments
 (0)