Jump to content

#1
tipforeveryone

tipforeveryone
  • Members
  • 112 posts
Below code was attached to a Pivot
function Script:Start()
self.box1 = Model:Box(0.2,0.2,0.2)
self.box1:SetPosition(self.entity:GetPosition())
self.box2 = Model:Box(0.2,0.2,0.2)
self.box2:SetPosition(self.entity:GetPosition() + Vec3(0.5,0,0))
end
function Script:UpdateWorld()
if window:KeyHit(Key.F2) then
local pos = self.box1:GetPosition()
local joint = Joint:Ball(pos.x,pos.y,pos.z,self.box2,self.box1)
joint:SetLimits(10,10)
joint:EnableLimits()

self.box2:SetMass(1)
self.box2:AddForce(100,100,100)
end
end

It works for Joint:Hinge(), I can not set minimum cone angle and twist angle for Joint:Ball anymore.

#2
tipforeveryone

tipforeveryone
  • Members
  • 112 posts
what is wrong? Any idea ?:)



Also tagged with one or more of these keywords: Joint, physics