New constraints are live!

This is pretty fun!

https://i.gyazo.com/943a3f1ba88f4fd2e236b9ac166af7cf.gif

And is playable:

27 Likes

Sick!

2 Likes

Added my constraint-chassis to my old vehicle. So much better.

6 Likes

Does Workspace.PGSPhysicsSolverEnabled need to be true to use these constraints? PrismaticConstraints weren’t working in one of my places until I set it to true.

1 Like

Yes these constraints work exclusively under PGS

1 Like

I created a new place and noticed it was on by default. Does that mean there’s no harm in enabling it in my existing places?

1 Like

If you are migrating an existing level, please read:

3 Likes

Any way we can get a small tutorial for constraints? For some people it is self explanatory, but other’s it isn’t. I would recommend a small video tutorial on how to set up some the constraints for their uses like with the car for example or the doors.

2 Likes

Used BallSocketConstraints as couplers on this Eurostar, works great and very stable!

12 Likes

It would be superb if the RodConstraint had an angle limit akin to two BallSocketConstraints paired together, that way you can eliminate the part that goes between the cars if you don’t need any visual indicator of such a connection.

4 Likes

I had some trouble designing a truck with a trailer. I connected the two using a rod constraint (I also used a rope) but when I turned my car, despite their being ‘tension’ in the rod, the trailers momentum did not change and it carried on moving in the direction it was already until it physically couldn’t and had to adjust to follow the car.

1 Like

You want a BallSocketConstraint for trailers. If the trailer is articulated (it has no wheels at the front), connect the trailer chassis to the tractor with a single BallSocketConstraint. If the trailer is not articulated (like you see with doubles, and your post suggested with the Rope/RodConstraint) then you need two Hinges/HingeConstraints in addition to the BallSocketConstraint. One of them is so the wheels can pivot on the vertical axis, and the other is so that the connection linkage can rotate up and down as it is connected to the rotating wheels. The connection linkage is connected with a BallSocketConstraint at the tractor. Here’s a picture of a real trailer like this:

You can see the front wheels are turned, and the connection linkage is rotated so it is resting on the ground.

9 Likes

The example place requires 4wd on a hill which is not available with keyboard controls?

2 Likes

Whoo! Made a sword fish simulator with this.

This is fantastic.

LookingFly.PNG

5 Likes

And I made a cape…

Unfortunately, I can’t set a limit to the hinges (you know, so the cape doesn’t go through me) without being able to spawn.

Here is my code (for a script in Workspace or ServerScriptService):

local function CharacterAdded(Character)
	if Character then
		local Torso = Character:WaitForChild("Torso")
		
		local TorsoAttachment = Instance.new("Attachment")
		TorsoAttachment.CFrame = CFrame.new(0,1,0.55)
		TorsoAttachment.Parent = Torso
		
		local Parts = {}
		for i = 1, 8 do
			local Part = Instance.new("Part")
			Part.BrickColor = BrickColor.new("Bright red")
			Part.Material = "SmoothPlastic"
			Part.CanCollide = false
			Part.Size = Vector3.new(2,0.4,0.2)
			Part.TopSurface = "Smooth"
			Part.BottomSurface = "Smooth"
			Part.Parent = Character
			
			local Mesh = Instance.new("BlockMesh")
			Mesh.Scale = Vector3.new(1,1,0.2)
			Mesh.Parent = Part
			
			local Attachment1 = Instance.new("Attachment")
			Attachment1.CFrame = CFrame.new(0,0.2,0)
			Attachment1.Parent = Part
			
			local Attachment2 = Instance.new("Attachment")
			Attachment2.CFrame = CFrame.new(0,-0.2,0)
			Attachment2.Parent = Part
			
			table.insert(Parts,{Attachment1,Attachment2})
		end
		
		local function Attach(Attachment1,Attachment2)
			local HingeConstraint = Instance.new("HingeConstraint")
			HingeConstraint.Attachment0 = Attachment1
			HingeConstraint.Attachment1 = Attachment2
			HingeConstraint.LimitsEnabled = true
			HingeConstraint.Parent = Attachment1.Parent
			
			return HingeConstraint
		end
		
		for i = 1, #Parts do
			local Table1,Table2 = Parts[i],Parts[i+1]
			if Table1 and Table2 then
				local AttachmentPart1 = Table1[2]
				local AttachmentPart2 = Table2[1]
				Attach(AttachmentPart1,AttachmentPart2)
			end
		end
		
		local TorsoHingeConstraint = Attach(TorsoAttachment,Parts[1][1])
		TorsoHingeConstraint.UpperAngle = -5
	end
end

local function PlayerAdded(Player)
	if Player then
		Player.CharacterAdded:connect(CharacterAdded)
		CharacterAdded(Player.Character)
	end
end

game.Players.PlayerAdded:connect(PlayerAdded)
for _,Player in pairs(game.Players:GetPlayers()) do
	spawn(function() PlayerAdded(Player) end)
end
2 Likes

Are those supposed to be gifs? Neither plays.

2 Likes

Nope, not gifs. Second image has nothing to show as the player never spawns.

1 Like

Yes sorry I’ve built the buggy with the controller in mind…

3 Likes

Good idea. We might implement the angular limits on rods for next release

5 Likes

For the angular limits on hinges you have to correctly set your secondary axis (y-axis). The limit constraints the angle between the secondary axes of the two attachments

3 Likes