MoveModeSwimclass
Swimming in water volumes, including assisted exits onto nearby banks.
Constructors1
Showing 1 constructors
public MoveModeSwim()
No results match this filter.
Methods12
Showing 12 methods
public virtual void AddVelocity()
Preserve the exit trajectory instead of applying ordinary swim acceleration.
void—public void CancelExit()
Cancel any pending exit after a reset, landing, interruption or obstruction.
void—public virtual bool IsStandableSurface(Sandbox.SceneTraceResult& modreq(System.Runtime.InteropServices.InAttribute) result)
| Parameter | Type | Description |
|---|---|---|
| result | SceneTraceResult& modreq(InAttribute) | — |
bool—protected virtual void OnDisabled()
Release transient references if the component is disabled during an exit.
void—protected virtual void OnFixedUpdate()
Sample water even when another movement mode is active.
void—public virtual void OnModeBegin()
Mark the controller as swimming when this mode is selected.
void—public virtual void OnModeEnd(Sandbox.Movement.MoveMode next)
Preserve open-water jumping, without adding another kick after a ledge exit.
| Parameter | Type | Description |
|---|---|---|
| next | MoveMode | — |
void—public virtual void PostPhysicsStep()
Stop assistance when an obstruction prevents the feet from reaching the top.
void—public virtual void PrePhysicsStep()
Detect the bank while swimming, then carry the body toward its moving landing. Collision response remains entirely in the native physics controller.
void—public virtual int Score(Sandbox.PlayerController controller)
Keep control until an exit lands, even after the character crosses the waterline.
| Parameter | Type | Description |
|---|---|---|
| controller | PlayerController | — |
int—No results match this filter.
Properties5
Showing 5 properties
public virtual bool Sandbox.Movement.MoveModeSwim.AllowGrounding { get; set; }
Landing is enabled during the exit but not during ordinary swimming.
bool—public bool Sandbox.Movement.MoveModeSwim.IsExitingWater { get; set; }
Whether the controller currently owns an assisted exit, including its dry portion.
bool—public int Sandbox.Movement.MoveModeSwim.Priority { get; set; }
Selection priority while sufficiently submerged. An active exit adds one.
int—public float Sandbox.Movement.MoveModeSwim.SwimLevel { get; set; }
Submerged fraction required for ordinary swimming.
float—public float Sandbox.Movement.MoveModeSwim.WaterLevel { get; set; }
Fraction of the character submerged in a water-tagged trigger.
float—No results match this filter.