How can i dampen the force when it is still? skinned mesh
01 | local Boat = script.Parent |
02 | local BodyForce = Boat:WaitForChild( "Force" ) |
03 | local WaveGenerator = require(game.ReplicatedStorage.Wave 2 ) |
04 | local DeapthBeforeSubmerged = 1 |
05 | local DisplacementAmount = 3 |
08 | local function FixedUpdate() |
09 | local WaveHight = WaveGenerator:Init().GetFloatation( nil ,Boat.Position,Vector 2. new(Boat.Size.X,Boat.Size.Z)) |
10 | local WaveHightYAxis = WaveHight.Y |
12 | if Boat.Position.Y < WaveHightYAxis then |
14 | local DisplacementMultiplier = math.clamp(WaveHightYAxis-Boat.Position.Y/DeapthBeforeSubmerged, 0 , 1 ) * DisplacementAmount |
15 | BodyForce.Force = Vector 3. new( 0 ,math.abs(workspace.Gravity)*DisplacementMultiplier*Boat:GetMass(), 0 ) |
18 | BodyForce.Force = Vector 3. new( 0 , 0 , 0 ) |
i tried to convert as much C# as i can
im pretty sure i got every thing working except that it keeps bouncing