Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Keeping Hinge Joints Connected?

A turret I've made uses a BodyGyro to aim its barrel at players, and then shoots a bullet towards the barrel's lookVector. This method would work great if the hinge joints that allow the gun to rotate freely didn't break apart every other time a server is started. Is there a way to keep this from happening?

1 answer

I don't think use a hinge is possible with what your doing, it might idk. But I would use a Motor hinde and set the Y C0 to the direction:

Hinge = Instance.new("Motor")
Hinge.Part0 = Base
Hinge.Part1 = Barrel
Hinge.C0 = Base.CFrame:inverse()
Hinge.C1 = Barrel.CFrame:inverse()

That should keep it connect as long as you don't CFrame it.

You can either turn it by using the DesiredAngle or C0-C1 properties. To look at all the properties and how to set them look at the wiki: http://wiki.roblox.com/index.php?title=RBX.lua.Motor_(Object)

It might be a bit confusing.

1 comment

0

No, the hinge works fine. it functions reliably in Solo and Online (when it doesn't fall apart). the only problem is that the model falls apart more often that it holds together despite having manually added welded surfaces and hinge surfaces where needed.

This discussion is preserved as it was. New answers, comments, and votes are closed.