OwenTheBell / RunRoom

0 stars 0 forks source link

Strafing while running forward results in moving way faster than usual running speed #23

Open OwenTheBell opened 7 months ago

OwenTheBell commented 7 months ago

Since strafing speed is added to the player's forward speed, the total horizontal velocity exceeds the 1000 speed cap.

Solution could be to treat both inputs as weights based on their forward contribution. With current numbers, strafing is 600 while a full speed forward run is 900. This results in a total speed of 1500, 40% from strafing and 60% from forward movement. That same ratio could be translated down to movement capped at the 900 speed. This would then be adjusted based on the current momentum. From a standstill, total speed would be 600, contributed to equally by 600 forward and 600 strafe. As momentum increases, the weight of forward speed on the overall speed is increased. This would also account for if momentum is increased above what the player can run at on their own.