diff --git a/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs b/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs index a0feab7052..02a8538531 100644 --- a/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs +++ b/Content.Shared/Movement/Components/MovementSpeedModifierComponent.cs @@ -15,6 +15,7 @@ namespace Content.Shared.Movement.Components public const float DefaultMinimumFrictionSpeed = 0.005f; public const float DefaultWeightlessFriction = 1f; public const float DefaultWeightlessFrictionNoInput = 0.2f; + public const float DefaultOffGridFriction = 0.05f; public const float DefaultWeightlessModifier = 0.7f; public const float DefaultWeightlessAcceleration = 1f; @@ -72,6 +73,12 @@ namespace Content.Shared.Movement.Components [ViewVariables(VVAccess.ReadWrite), DataField] public float WeightlessFrictionNoInput = DefaultWeightlessFrictionNoInput; + /// + /// The negative velocity applied for friction when weightless and not standing on a grid or mapgrid + /// + [ViewVariables(VVAccess.ReadWrite), DataField] + public float OffGridFriction = DefaultOffGridFriction; + /// /// The movement speed modifier applied to a mob's total input velocity when weightless. /// diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 1f64717823..c41db21b01 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -214,7 +214,9 @@ namespace Content.Shared.Movement.Systems if (weightless) { - if (worldTotal != Vector2.Zero && touching) + if (gridComp == null && !MapGridQuery.HasComp(xform.GridUid)) + friction = moveSpeedComponent?.OffGridFriction ?? MovementSpeedModifierComponent.DefaultOffGridFriction; + else if (worldTotal != Vector2.Zero && touching) friction = moveSpeedComponent?.WeightlessFriction ?? MovementSpeedModifierComponent.DefaultWeightlessFriction; else friction = moveSpeedComponent?.WeightlessFrictionNoInput ?? MovementSpeedModifierComponent.DefaultWeightlessFrictionNoInput;