Jump to content

I make a rope, but it's intermittent


NoIE
 Share

Recommended Posts



post-12936-0-64657600-1418150517_thumb.gif

There are many cylinders, their names are ropeRoot, rope2, rope3 ... Each cylinder have a children - center.

post-12936-0-05610500-1418150844_thumb.gif

code JointBall.lua for ropeRoot, rope2, rope3 ... :
Script.parentObj = nil--entity

function Script:Start()
local center = self.entity:FindChild("center")
if center~= nil then
local pos = center:GetPosition(true)
self.jointBall = Joint:Ball(pos.x, pos.y,pos.z,self.entity,self.parentObj)
end
end




code Mass.lua for Sphere 1 :

Script.parentObj = nil--entity

function Script:Start()
local center = self.entity:FindChild("center")
if center~= nil then
local pos = center:GetPosition(true)
self.jointBall = Joint:Ball(pos.x, pos.y,pos.z,self.entity,self.parentObj)

end
self.timer = Time:GetCurrent() + 8000
end

function Script:Draw()
if self.timer < Time:GetCurrent() then
self.entity:SetMass(30)
end
end



After 8 seconds, the sphere's weight is set to 30.

edit: Can I use physics sub-stepping ?

Please forgive my poor English.

 

post-12936-0-43515100-1418403285.gif

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...