mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add Hitbox.gravityMultiplier
This commit is contained in:
parent
f3201b7742
commit
f52a435aea
6 changed files with 4 additions and 5 deletions
|
|
@ -97,6 +97,7 @@ void Player::updateInput(PlayerInput& input, float delta) {
|
|||
|
||||
hitbox->linearDamping = PLAYER_GROUND_DAMPING;
|
||||
hitbox->verticalDamping = flight;
|
||||
hitbox->gravityMultiplier = flight ? 0.0f : 1.0f;
|
||||
if (flight){
|
||||
hitbox->linearDamping = PLAYER_AIR_DAMPING;
|
||||
if (input.jump){
|
||||
|
|
@ -118,7 +119,7 @@ void Player::updateInput(PlayerInput& input, float delta) {
|
|||
(input.noclip && flight == noclip)){
|
||||
flight = !flight;
|
||||
if (flight){
|
||||
hitbox->grounded = false;
|
||||
hitbox->velocity.y += 1.0f;
|
||||
}
|
||||
}
|
||||
if (input.noclip) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue