File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
lua/pac3/core/client/parts Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ BUILDER:StartStorableVars()
3838 :GetSet (" MaxSpeedDamp" , 1000 )
3939 :GetSet (" MaxAngularDamp" , 1000 )
4040 :GetSet (" DampFactor" , 1 )
41+ :GetSet (" DampFactorPost" , 0 )
42+ :GetSet (" AngleDampFactorPost" , 0 )
4143 BUILDER :SetPropertyGroup (" Speeds" )
4244
4345 :GetSet (" ConstantVelocity" , Vector (0 ,0 ,0 ))
@@ -227,6 +229,14 @@ function PART:OnThink()
227229 phys :AddVelocity (0.5 * vec :GetNormalized () * extra_dist / math .Clamp (self .SecondsToArrive ,0.05 ,10 ))
228230 end
229231 end
232+ if self .DampFactorPost ~= 0 then
233+ local vel = phys :GetVelocity ()
234+ phys :SetVelocity ((1 - self .DampFactorPost ) * vel )
235+ end
236+ if self .AngleDampFactorPost ~= 0 then
237+ local angvel = phys :GetAngleVelocity ()
238+ phys :SetAngleVelocity ((1 - self .AngleDampFactorPost ) * angvel )
239+ end
230240 else
231241 if self .ConstrainSphere ~= 0 then
232242 local offset = self .Parent :GetWorldPosition () - phys :GetPos ()
You can’t perform that action at this time.
0 commit comments