Yue Posted January 31, 2021 Share Posted January 31, 2021 Hi, I am trying to create a simple ragdoll effect on a column. The idea is to assign to those bones a solid body, which I have referenced in green and red, where each one goes in the respective bone. When I run the program, I move the colored bodies to the position of each bone, and then I add mass to those bodies and tell the bones that their parents are those colored bodies. Everything works partly well. Script.bodyHead = nil --Entity "Body Head" Script.bodyFeet = nil --Entity "Body Feet" function Script:Start() --Column self.boneHead = self.entity:FindChild("Bone1") self.boneFeet = self.entity:FindChild("Bone") self.bodyHead:SetMass(0) self.bodyFeet:SetMass(0) self.r = false end function Script:UpdateWorld() if Window:GetCurrent():KeyHit(Key.R) then if self. r == false then self.bodyHead:SetPosition(self.boneHead:GetPosition(true)) self.bodyFeet:SetPosition(self.boneFeet:GetPosition(true)) self.boneHead:SetParent(self.bodyHead) self.boneFeet:SetParent(self.bodyFeet) self.r = true end end if Window:GetCurrent():KeyHit(Key.T) then if self.r == true then self.bodyHead:SetMass(1.0) self.bodyFeet:SetMass(1.0) end end end The spine body falls in the direction of the force of gravity, since the two bones follow the position of the colored rigid bodies. The problem is that depending on a certain movement of the camera the column disappears. I am grateful for any suggestions. So with that taken care of, I would have to think about joints. Quote Link to comment Share on other sites More sharing options...
Yue Posted February 3, 2021 Author Share Posted February 3, 2021 Quote Link to comment Share on other sites More sharing options...
Yue Posted February 4, 2021 Author Share Posted February 4, 2021 Ragdolls disappearing - General Discussion - Leadwerks Community Something to work on. Quote Link to comment Share on other sites More sharing options...
Yue Posted February 4, 2021 Author Share Posted February 4, 2021 Ok, Test. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.