Jump to content

This is a bug?


Yue
 Share

Recommended Posts

image.thumb.png.30a341077af1dbd178b4d6bffaf395df.png

 

When I press the R key, the joint searches for the position and rotation of the cylinders.

From my point of view the joint should fall to the ground without any problem, but I have a strange behavior, and the joint moves to the right of the stage until it falls off the platform.

image.thumb.png.3dd3af85406ea719f0bcc0ed2dfab765.png

 

Script.player = nil --entity "Player"
Script.mThorax = nil --entity "mThorax"
Script.thorax = nil --entity "Thorax"


function Script:Start()

	self.mThorax:SetParent(self.player,true)

	self.player:SetColor(1,0,0)
	
	self.entity:SetMass(10)
	self.thorax:SetMass(10)

	self.pin = self.entity:GetPosition(true)

	self.joint = Joint:Hinge(self.pin.x,self.pin.y,self.pin.z,1,0,0, self.thorax, self.entity)

	
	self.joint:EnableLimits()
	self.joint:SetLimits(0,90)
	


end



function Script:UpdateWorld()
	self.GetRot = self.player:GetRotation(true)
	self.GetRot2= self.mThorax:GetRotation(true)
	self.GetPos = self.player:GetPosition(true)
	self.GetPos2= self.mThorax:GetPosition(true)


	if Window:GetCurrent():KeyDown(Key.G) then 
		self.player:Turn(0,1,0,false)
	
		
	end
	

	
	
	
	if Window:GetCurrent():KeyHit(Key.R) then
		self.entity:SetRotation(self.GetRot,true)
		self.entity:SetPosition(self.GetPos,true)
		
		
		self.thorax:SetPosition(self.GetPos2,true)
		self.thorax:SetRotation(self.GetRot2,true)

		self.player:SetParent(self.entity,true)
		self.mThorax:SetParent(self.thorax,true)
	end


end

 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

I discovered something, at the moment of moving the rigid bodies of the joint, the target cylinders have the collision prop, that's why the effect, however if I put the collision of those cylinders in Collision.None ( Simulating Ragdoll ). This does not happen anymore.

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

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