Jump to content

Problem reset Ragdoll


Yue
 Share

Recommended Posts

image.thumb.png.e565ffa122b63de0d2b3bd1c7c2cf798.png

 

When the player triggers his death, it triggers the ragdoll effect and the character is lying on the ground. The next step is to release the rigid bodies of their parents bones, I have tried to position the player back to the starting point, but this does not happen, only the player controller remains moving, but the character, the mesh remains in the place of the ragdoll effect, I have tried to use an animation but it does not work. I think I may have to reload the character and remove that one. any suggestions?

Translated with www.DeepL.com/Translator (free version)

 

	function this:Start()

				if self.r == true then 
					self:FindMeshs()
					self:FindBones()
					self:SetPosition(true)
					self:SetRotation()
					self:SetParent(true)
					self:SetMass(1.0)
					self:GetPosition()
					self:CreateJoints(true)
					self.player:SetPhysicsMode(Entity.RigidBodyPhysics)
					self.player:SetMass(0.0)
				
				end
					
			end


			function this:End()
				
					self:SetParent(false)
					--self:SetPosition(false)
					--self:SetMass(0)
					--self:CreateJoints(false)
					self.player:SetPhysicsMode(Entity.CharacterPhysics)
					self.player:SetMass(10)
					--self.player:SetPosition(0,0,0,false)
					
					self.player:SetColor(0,1,0)
					
					
				
			end 

 

 

 

Link to comment
Share on other sites

9 hours ago, Defranco said:

Are you using:

entity:Release()

to clear the entity after death?

No, the idea is to reuse the system again and have it ready for when you restart the game.

This is also with a view to the ragdoll being activated and the player standing up, like in gta V when run over by a car, but it looks like the skeleton is unhooked from the mesh.

 

 

Link to comment
Share on other sites

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...