fix: jump speed being incorrect
This commit is contained in:
parent
6fbdfaf863
commit
88e6017903
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ floor_max_angle = 0.460767
|
|||
floor_snap_length = 0.35
|
||||
acceleration = 10.0
|
||||
target_speed = 25.0
|
||||
jump_impulse = Vector2(0.9, 5)
|
||||
|
||||
[node name="PlayerStateMachine" type="PlayerStateMachine" parent="."]
|
||||
|
||||
|
|
Loading…
Reference in a new issue