Sign in to follow this  
Followers 0
tipforeveryone

Joint:SetLimits() is not working for Joint:Ball()

2 posts in this topic

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.

0

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Create Your Account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0