Jump to content

How can I prevent two parts from colliding in a joint?


Recommended Posts

Posted

The question is clear, I have two pieces joined by a joint, but I need them not to collide, what happens is that when the ragdoll is launched, the character has death cramps, of epilepsy. 

  • Haha 1

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

  • 2 weeks later...
Posted
On 1/2/2022 at 6:12 AM, Josh said:

Two entities that are connected with a joint will not collide with each other.

Your comment is spot on.  What happens is that by moving the rigid bodies to the joints of the character, there is a clash between several pieces while creating the joints. 

In this case, setting the collision to debris type solves the problem. 

Another issue is that I have problems with the rotations of the bone reticulations and the rotation of the rigid body, for some reason it doesn't match.

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

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

If you are creating a hinge joint, the starting orientation is an angle of zero. There is no correlation between the entity rotations and the joint angle.

  • Like 1

Let's build cool stuff and have fun. :)

Posted

Now I'm having this problem, my feet are stretching strangely.

 

image.thumb.png.19570d24a3b3a0717e9414910f421fe7.png

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

Are you using SetMatrix()? You should probably just use SetPosition and SetRotation (using a quaternion) to avoid any problems with scaling.

  • Like 1

Let's build cool stuff and have fun. :)

Posted
6 hours ago, Josh said:

Are you using SetMatrix()? You should probably just use SetPosition and SetRotation (using a quaternion) to avoid any problems with scaling.

What I am doing is taking the bone of the foot and telling it to be son of the rigid body for the ragdoll effect of the foot. 

Then I have found solution to the problem, and that is that it is the respective rotation of the bone I have to set it to 0,0,0 locally. 

 

--Test Ragdoll.
	if Input:GetKeyHit(Key.R) and self.ragdoll == false then 
		self.ragdoll = true
		
		if self.ragdoll == true and self.player:GetPhysicsMode() ~=  Entity.RigidBodyPhysics then 
			if self.player:GetPhysicsMode() == Entity.CharacterPhysics then 
				self.player.meshPlayer:SetMass(0)
				self.player:SetPhysicsMode(Entity.RigidBodyPhysics)
				
				self.RPlayer:InitShapes()
				self.RPlayer:InitJoints()
				self.RPlayer:SetRotations(true)	
				self.RPlayer:SetPositions()
				
				self.RPlayer:SetParents()
				self.RPlayer:SetMass(10)
					
			end
		end 
	end

The above script is the prototype to activate the ragdoll effect, I am using the SetRotation and SetPosition.  

 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

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.

×
×
  • Create New...