Hello! I’m making a catapult, but every time I try editing, instead of the catapult facing up, it goes down. I’ve tried changing the speed, torque, and angle variables. Here is my code:
local hinge1 = script.Parent.LeftHinge.HingeConstraint
local hinge2 = script.Parent.RightHinge.HingeConstraint
local speed = 100
local targetangle = 90
local torque = 100
script.Parent.Button.ClickDetector.MouseClick:Connect(function()
hinge1.TargetAngle = targetangle
hinge2.TargetAngle = targetangle
hinge1.ServoMaxTorque = torque
hinge2.ServoMaxTorque = torque
hinge1.AngularSpeed = speed
hinge2.AngularSpeed = speed
task.wait(2)
hinge1.TargetAngle = 0
hinge2.TargetAngle = 0
hinge1.AngularSpeed = 2
hinge2.AngularSpeed = 2
task.wait(1)
hinge1.AngularSpeed = 0
hinge2.AngularSpeed = 0
hinge1.ServoMaxTorque = 0
hinge2.ServoMaxTorque = 0
end)
I would greatly appreciate it if you helped. Thanks.