Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Keeping Hinge Joints Connected?

Asked by 10 years ago

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

Log in to vote
-1
Answered by 10 years ago

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.

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. deaththerapy 60 — 10y
Ad

Answer this question