Boatdrag
Based on game build 714014 | Last updated: 2026-03-04
Overview
Boatdrag is a lightweight component that manages hydrodynamic drag and velocity constraints for watercraft entities (e.g., boats). It stores scalar multipliers that affect how quickly a boat accelerates, decelerates, or responds to external forces like sails or manual pushing. This component does not perform movement directly but provides data consumed by locomotion or physics systems (e.g., via velocity or custom boat controllers).
Usage example
local inst = CreateEntity()
inst:AddComponent("boatdrag")
-- Configure drag characteristics
inst.components.boatdrag.drag = 0.95
inst.components.boatdrag.max_velocity_mod = 1.2
inst.components.boatdrag.forcedampening = 0.1
-- Retrieve debug string for debugging UI or logs
print(inst.components.boatdrag:GetDebugString())
Dependencies & tags
Components used: None identified
Tags: None identified
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
drag | number | 0 | Coefficient of drag (typically 0–1), applied to reduce velocity over time. |
max_velocity_mod | number | 1 | Scalar multiplier applied to the maximum allowed velocity of the boat. |
forcedampening | number | 0 | Additional damping force applied to counteract sudden directional changes. |
sailforcemodifier | number | 1 | Multiplier applied to force generated by sails (not used internally in this component but stored for external use). |
Main functions
GetDebugString()
- Description: Returns a formatted string containing current drag parameters for debugging purposes.
- Parameters: None.
- Returns:
string— e.g.,"drag:0.950000, max_velocity_mod:1.200000, forcedampening:0.100000". - Error states: None.
Events & listeners
Not applicable.