Having troubles with "PhysObj:ApplyForceOffset" and custom entity
1 replies, posted
Having trouble with making vehicle hover with "ApplyForceOffset"
Actually I check distance between line start and line end(With trace) and then apply force from wheel position, and then it jumps like that: GIF
I need it for making suspension for car
Is there any ideas to fix that?
(code with aplpying force, if needed)
local dist = self:GetBonePosition(self:LookupBone(wh)):Distance(tr.HitPos)
self.Wheels[wh.."_Lerp"] = !self.Wheels[wh.."_Lerp"] and 0 or Lerp(.1, self.Wheels[wh.."_Lerp"], (self.WheelRadius-dist))
PhysObj:ApplyForceOffset( Vector(0,0,self.Wheels[wh.."_Lerp"]*1000), self:GetBonePosition(self:LookupBone(wh)) )
Just from the GIF looks like your wheels weigh too little, and are actually folding/collapsing under the vehicle's weight.
Sorry, you need to Log In to post a reply to this thread.