I have a LocalScript in StarterPlayerScripts that fires when certain parts are clicked. Here is the script:
local speed = game.Workspace.SpinStand.HingeConstraint.AngularVelocity
local slow = game.Workspace.SlowSpinSpeed
local med = game.Workspace.MedSpinSpeed
slow.ClickDetector.MouseClick:Connect(function()
speed = 1.5
print("Slower")
end)
med.ClickDetector.MouseClick:Connect(function()
speed = 4
print("Normal")
end)
For some reason, the AngularVelocity for the HingeConstraint doesn’t change when the parts are clicked. I tested it, and I checked and saw that it stayed the same. I know the script is running when it’s clicked because the
print() messages appear in the output.
-
What do you want to achieve? I want to make it so when certain parts are clicked, the AngularVelocity of a HingeConstraint changes.
-
What is the issue? The script fires correctly, except the AngularVelocity doesn’t change for some reason.
-
What solutions have you tried so far? I searched for similar posts, and look at the Developer Hub, but I found nothing that could help me.
I don’t know if there’s something that I’m just not seeing or not. Any help is appreciated.