Tween not playing

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)
2 Likes

I saw everything. Your 2 second video is now remembered.

2 Likes

Put this in the door model and see if it helps

for _, object in pairs(script.Parent:GetChildren()) do 
	if object:IsA("BasePart") then 
		object:SetNetworkOwner()
	end
end
1 Like

Now that’s how you write a code! … I’d just work on fixing the animations with what you got there.

2 Likes

I tried your solution but it still does not fix it unfortunately, i tried changing it to GetDescendants to get all parts but it still dod not work unfortunately, thank you though.

2 Likes

There is something you need to check, make sure the button is not changing the value on the client. if it is, you need to create a RemoteEvent. a RemoteEvent could also help you if the server is not sending the data to the client correctly.

I think we can all say that it has nothing to do with any values being changed on client

the issue has to be something regarding how driverseats ‘act’ when a player sits (or probably even regular seats

I am not too familiar with this issue so I would suggest try finding free resources of ‘buses with opening door’ or equivalent samples to try and pinpoint the issue if no one here can identify

That is not the problem, the button is a normal script that changes the value of Open.

Everything I do know is that it did not work before without a drivekit in another model, but then I didn’t take a seat. I will test it.

Edit: I get the same issue when testing it on all other models.

1 Like

Hello

I have found the solution (well, kind of) to the problem. It has as @Juicy_Fruit and @TheSai_ki said, to do about Network Ownership, since the bus is anchored when I play the tween, the door needs to have its Network Owner as the Server for the animation to show.

1 Like

I’m glad you found out your issue.

You can still use this one for that fix.

If you think we’ve helped you and that you’ve found your fix, remember to mark one of our replies or even your own as the Solution. :slight_smile:
Edit: Glad to of helped you, @vike001141

:slight_smile:

1 Like

I have one issue still, the animation is going to be played when the bus is anchored, it does not play then. Anyone has a clue of any workarounds or something like that?

I am sorry, but the tween is just acting wierd, It won’t play when the motorpart is welded to an anchored part, It simply won’t tween. It still works manually changing desiredangle and maxvelocity, I really want this to work but the rendering is wierd.