flying knockback as well
This commit is contained in:
@@ -27,7 +27,7 @@ public partial class CFlyingMovement : Node3D, IMoveable
|
||||
// Check if we have a direct line of sight to the player
|
||||
if (!_movingToDesiredHeight)
|
||||
{
|
||||
velocity = direction * RMovement.Speed;
|
||||
velocity = velocity.Lerp(direction * RMovement.Speed, (float) inputs.delta * RMovement.Acceleration);
|
||||
|
||||
var query = PhysicsRayQueryParameters3D.Create(GlobalPosition, target, TerrainCollision);
|
||||
var result = spaceState.IntersectRay(query);
|
||||
@@ -39,7 +39,7 @@ public partial class CFlyingMovement : Node3D, IMoveable
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity = _randomDirection * RMovement.Speed;
|
||||
velocity = velocity.Lerp(_randomDirection * RMovement.Speed, (float) inputs.delta * RMovement.Acceleration);
|
||||
|
||||
var groundQuery = PhysicsRayQueryParameters3D.Create(GlobalPosition, GlobalPosition+Vector3.Down*RMovement.TargetHeight, TerrainCollision);
|
||||
var groundResult = spaceState.IntersectRay(groundQuery);
|
||||
|
||||
@@ -27,7 +27,7 @@ public partial class CGroundedMovement : Node3D, IMoveable
|
||||
if (WallInFrontRayCast.IsColliding())
|
||||
velocity.Y = RMovement.Speed;
|
||||
else if (!inputs.isOnFloor)
|
||||
velocity += inputs.gravity * (float)inputs.delta;
|
||||
velocity += inputs.gravity * (float)inputs.delta * RMovement.GravityModifier;
|
||||
|
||||
return velocity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user