fix: jump speed being incorrect

This commit is contained in:
Sara 2025-06-09 01:12:53 +02:00
parent 6fbdfaf863
commit 88e6017903
2 changed files with 2 additions and 2 deletions

View file

@ -194,8 +194,7 @@ void JumpingState::state_entered() {
Vector3 const current{this->get_body()->get_velocity()};
Vector2 const impulse{this->get_body()->get_jump_impulse()};
this->get_body()->set_velocity( (
Vector3{current.x, impulse.y, current.z}
+ current.normalized() * impulse.x
Vector3{current.x * impulse.x, impulse.y, current.z * impulse.x}
));
this->get_body()->get_anim()->play("jump");
}