Use Hinge Constraint with Assembly Parts?

Hello, I am making a plane that relies on it being an assembly. This is because I use Vector Forces that are applied to the center of mass of the plane.

When I tried to add a “landing gear” that turns the plane using a Hinge Constraint, the landing gear part would not be included as part of the plane assembly. Because of this, the true center of mass of the plane shifted forward (because the part is connected to the front of the plane by the hinge constraint), while the assembly’s center of mass stayed the same (too far backward). Because of this, the Vector Forces that are set to apply a force at the Center of Mass of the plane assembly apply the force too far backward, making the plane keep diving forward.

I tried setting the landing gear part to be Massless, but that did not fix the problem.

Is there a way to have a part that is part of an assembly, but that is connected to the assembly by a hinge? Or is there a way to move/rotate parts of an assembly that are welded together?

  1. In the Roblox Studio, create an assembly part and place it in the workspace.

  2. Create another part that you want to constrain to the assembly part using the Hinge Constraint.

  3. Use the part’s Parent property to set the parent of the constrained part to the assembly part. This will make the constrained part a child of the assembly part.

  4. Use the part’s CreateHingeConstraint method to create a new Hinge Constraint object. You can specify the axis of rotation for the constraint using the ConstraintAxis property.

  5. Use the Hinge Constraint object’s Parent property to set the parent of the constraint to the constrained part. This will make the constraint a child of the constrained part.

Here is an example of how you can use the Hinge Constraint with an assembly part:

local assemblyPart = script.Parent -- Replace "script.Parent" with the actual assembly part

local constrainedPart = Instance.new("Part")
constrainedPart.Size = Vector3.new(1, 1, 1)
constrainedPart.Parent = assemblyPart

local hingeConstraint = constrainedPart:CreateHingeConstraint()
hingeConstraint.ConstraintAxis = Vector3.new(1, 0, 0)
hingeConstraint.Parent = constrainedPart

Hmm - I can’t seem to be able to use “Part:CreateHingeConstraint().” Either it doesn’t exist anymore, or I’m missing something… does the “ConstrainedPart” have to be a child of the Assembly Root Part? Or can it be a child of any part that is part of the assembly?

That was mainly used for example code however though

local part1 = workspace:FindFirstChild("Part1") -- First Part
local part2 = workspace:FindFirstChild("Part2") -- Second Part

local hinge = part1:CreateHingeConstraint(part2)

Thanks!

You could use the WeldConstraint and set the MaxTorque to something high.
Here’s an example with a model:

And here’s the code:
local model = game.Workspace:WaitForChild(“Model”)

local weld = Instance.new(“WeldConstraint”, model)
weld.MaxTorque = 50000

local bodyPosition = Instance.new(“BodyPosition”, model)
bodyPosition.position = Vector3.new(0, 10, 0)