diff --git a/NewHorizons/Builder/Body/WaterBuilder.cs b/NewHorizons/Builder/Body/WaterBuilder.cs index 9b5a81659..ae72bce6e 100644 --- a/NewHorizons/Builder/Body/WaterBuilder.cs +++ b/NewHorizons/Builder/Body/WaterBuilder.cs @@ -114,6 +114,8 @@ public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, Wate fluidVolume._attachedBody = rb; fluidVolume._triggerVolume = buoyancyTriggerVolume; fluidVolume._radius = waterSize; + fluidVolume._buoyancyDensity = module.buoyancy; + fluidVolume._density = module.density; fluidVolume._layer = LayerMask.NameToLayer("BasicEffectVolume"); var fogGO = GameObject.Instantiate(_oceanFog, waterGO.transform); diff --git a/NewHorizons/External/Modules/VariableSize/WaterModule.cs b/NewHorizons/External/Modules/VariableSize/WaterModule.cs index 82b7446bb..5180c02d9 100644 --- a/NewHorizons/External/Modules/VariableSize/WaterModule.cs +++ b/NewHorizons/External/Modules/VariableSize/WaterModule.cs @@ -1,5 +1,6 @@ -using NewHorizons.Utility; +using NewHorizons.Utility; using Newtonsoft.Json; +using System.ComponentModel; namespace NewHorizons.External.Modules.VariableSize { @@ -11,6 +12,16 @@ public class WaterModule : VariableSizeModule /// public float size; + /// + /// Density of the water sphere. The higher the density, the harder it is to go through this fluid. + /// + [DefaultValue(1.2f)] public float density = 1.2f; + + /// + /// Buoyancy density of the water sphere + /// + [DefaultValue(1f)] public float buoyancy = 1f; + /// /// Tint of the water /// diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index c69a205c2..7c70ab889 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2573,6 +2573,18 @@ "description": "Size of the water sphere", "format": "float" }, + "density": { + "type": "number", + "description": "Density of the water sphere. The higher the density, the harder it is to go through this fluid.", + "format": "float", + "default": 1.2 + }, + "buoyancy": { + "type": "number", + "description": "Buoyancy density of the water sphere", + "format": "float", + "default": 1.0 + }, "tint": { "description": "Tint of the water", "$ref": "#/definitions/MColor"