had a script, its working and printing proper codes as tested but the Tween doesn’t play neither the door plays the tween itself. Can anyone help me out with this one?
local TweenService = game:GetService("TweenService")
local TweenInf = TweenInfo.new(2, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut)
--//
local DoorBase = script.Parent.DoorBase.DoorBase
local DoorHandle = script.Parent.DoorHandle
local ClickDetect = DoorHandle.Click
local DoorToggle = false
local Goal_Open = {}
Goal_Open.C0 = CFrame.Angles(0, 90, 0)
Goal_Open.C0 = CFrame.new(0,0, -3)
local Goal_Close = {}
Goal_Close.C0 = CFrame.Angles(0, -90, 0)
Goal_Close.C0 = CFrame.new(0,0, -3)
ClickDetect.MouseClick:Connect(function()
if DoorToggle == false then
print("Door Clicked: Opened")
print(DoorToggle)
TweenService:Create(DoorBase, TweenInf, Goal_Open):Play()
DoorToggle = true
elseif DoorToggle == true then
print("Door Clicked: Closed")
print(DoorToggle)
TweenService:Create(DoorBase, TweenInf, Goal_Close):Play()
DoorToggle = false
end
end)
I don’t think your using TweenService correctly, your changing a property twice in the same tween which I think doesn’t work, try doing something like this:
Are you using motor6D’s to do this?
I think you should tween the CFrame/Position of the door, you can use attachments to make it easy to use.
You can also use Hinge limits I think, I remember using this before to make a realistic door once.
did it on the part with welds too. Like- Shouldn’t it be moving with the tween as well when I tweened the parts? That’s what made me question bc I’ve done that before and it didn’t became a problem with me tweening parts with welds.
Yeah but all of it tweens C0 which is a property of Weld, and we’ve established that C0 cannot be written to. I don’t see code that tweens the position of the part for example.