Hello again, I am animating a new door and I have ran into a problem
The tween works perfectly with a drivekit when no-one is in the driveseat, altough the animation does not play for the client but only for the server and when the animation finishes the doors just act wierd with rendering not rendering. It is just overall wierd, I think you will get a better understanding of it when you watch the video.
I have tried to change the part that the pivot is welded to to see if that was the difference.
The script is not the problem probably, because it works when no-one is in the driveseat.
local L = script.Parent.L
local R = script.Parent.R
local RPivot1 = R.Pivot1
local RPivot2 = R.Pivot2
local LPivot1 = L.Pivot1
local LPivot2 = L.Pivot2
local Open = script.Parent.Open
local Closed = script.Parent.Closed
local Passop = script.Parent.Passop
local IsClosing = script.Parent.IsClosing
local Sound = script.Parent.Sound
local TweenService = game:GetService("TweenService")
local GoalR1 = {CurrentAngle = 2}
local GoalR2 = {CurrentAngle = -2}
local GoalL1 = {CurrentAngle = -2}
local GoalL2 = {CurrentAngle = -2.3}
local GoalClose = {CurrentAngle = 0}
local TweenInfoROpn = TweenInfo.new(math.random(4,4.5),Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0)
local TweenInfoLOpn = TweenInfo.new(math.random(4,4.5),Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0)
local TweenInfoRCls = TweenInfo.new(math.random(4,5.5),Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0)
local TweenInfoLCls = TweenInfo.new(math.random(4,5.5),Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0)
local TweenOpenR1 = TweenService:Create(RPivot1.Motor,TweenInfoROpn,GoalR1)
local TweenOpenR2 = TweenService:Create(RPivot2.Motor,TweenInfoROpn,GoalR2)
local TweenOpenL1 = TweenService:Create(LPivot1.Motor,TweenInfoLOpn,GoalL1)
local TweenOpenL2 = TweenService:Create(LPivot2.Motor,TweenInfoLOpn,GoalL2)
local TweenCloseR1 = TweenService:Create(RPivot1.Motor,TweenInfoRCls,GoalClose)
local TweenCloseR2 = TweenService:Create(RPivot2.Motor,TweenInfoRCls,GoalClose)
local TweenCloseL1 = TweenService:Create(LPivot1.Motor,TweenInfoLCls,GoalClose)
local TweenCloseL2 = TweenService:Create(LPivot2.Motor,TweenInfoLCls,GoalClose)
function Changed()
if Open.Value == true then
Closed.Value = false
Sound.Open:Play()
Sound.Close:Stop()
TweenOpenR1:Play()
TweenOpenR2:Play()
TweenOpenL1:Play()
TweenOpenL2:Play()
elseif Open.Value == false then
IsClosing.Value = true
Sound.Open:Stop()
Sound.Close:Play()
TweenCloseR1:Play()
TweenCloseR2:Play()
TweenCloseL1:Play()
TweenCloseL2:Play()
end
end
function Finished(State)
if State == Enum.PlaybackState.Completed then
IsClosing.Value = false
Closed.Value = true
end
end
Open.Changed:Connect(Changed)
TweenCloseL1.Completed:Connect(Finished)