So I was making a gate system and when the when I rotate the Hinge, the welded part doesn’t rotate with the hinge. Anyone can help me?
1 Like
Yes, it is enabled.
character lmit
1 Like
Could you send a file of the spinning object (I assume a door)
Are both objects un-anchored?
Only 1 part is anchored, which is the hinge.
The main part needs to be un-anchored for it to spin
1 Like
If the way you rotate the hinge is using CFrame or Orientation via script then weldConstrant won’t work. You have to use physical means to rotate the hinge.
1 Like
I assume you want to make the door swing open yes?
why not just use the tweenservice
here is an example from my other project
local Tween = game:GetService("TweenService")
local Info = TweenInfo.new(1, Enum.EasingStyle.Sine)
local ProximityPrompt = script.Parent
local RotationPart = ProximityPrompt.Parent.Parent.Parent.rotation
local IsOpen = false
ProximityPrompt.Triggered:Connect(function(plr)
if IsOpen then
Tween:Create(RotationPart, Info, {CFrame = RotationPart.CFrame * CFrame.Angles(0, math.rad(-90), 0)}):Play()
IsOpen = false
else
Tween:Create(RotationPart, Info, {CFrame = RotationPart.CFrame * CFrame.Angles(0, math.rad(90), 0)}):Play()
IsOpen = true
end
end)
Set up:
Result:
I got an error in my script
22:33:56.161 Workspace.Gate.Lever.Script:17: attempt to call a TweenInfo value - Server - Script:17
22:33:56.161 Stack Begin - Studio
22:33:56.161 Script 'Workspace.Gate.Lever.Script', Line 17 - Studio - Script:17
22:33:56.161 Stack End - Studio
here’s the code incase if you need it
local model = script.Parent
local pullsound = model.Pull
local tweentarget = model.mover
local goal = model.goal
local tweenservice = game:GetService("TweenService")
local gatemodel = script.Parent.Parent.Gate
script.Parent:MoveTo(script.Parent.Parent.leverplace.Position)
model.base.Attachment.ProximityPrompt.Triggered:Connect(function()
local tween = tweenservice:Create(tweentarget, TweenInfo.new(0.5, Enum.EasingStyle.Elastic, Enum.EasingDirection.InOut), {CFrame = goal.CFrame})
pullsound:Play()
gatemodel.Open:Play()
tween:Play()
model.base.Attachment.ProximityPrompt.Enabled = false
task.wait(1.7)
local opentween = tweenservice:Create(gatemodel.Gate, TweenInfo.new(0.5, Enum.EasingStyle.Elastic, Enum.EasingDirection.InOut) {CFrame = gatemodel.Gate.CFrame * CFrame.Angles(0, math.rad(90), 0)})
opentween:Play()
end)
uh oh someone forgot to put " , " between property table and tweeninfo