@@ -325,10 +325,13 @@ public class Demonic : MoveCharacter
ChangeState(CharacterState.Idle);
break;
}
- if (!foot.TrigGround && !canFly)
+ if (!foot.TrigGround)
{
rb.velocity += Vector3.up * extraFallGravity * Time.deltaTime;
+ Vector3 vel = rb.velocity;
+ vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
+ rb.velocity = vel;
case CharacterState.Attack:
if (attackTime <= 0)
@@ -274,6 +274,9 @@ public class Enemy : MoveCharacter
@@ -16,6 +16,7 @@ public class MoveCharacter : Character
public float weakTime;
public float totalWeakTime;
public float weakUpSpeed = 10f;
+ public float decelerationRatio = 1f;
public override void BeHit(int damage, Vector3 force, bool changeHurt, float hurtTime, float repelValue)
@@ -522,6 +522,13 @@ public class PlayerController : MoveCharacter
+ {
+ rb.velocity += Vector3.up * extraFallGravity * Time.deltaTime;
+ }
CachedPlayerInput();