Double Door opening weirdly

I’m trying to make my double door have a tween open and close animation, but it just ends up looking really weird.

Moon Animator / What I wanted to happen:

What ended up happening:

If you want to review my code to find any possible fixes, here:

local TweenService = game:GetService("TweenService")
local door = script.Parent
local doorRoot = door.LDoor.PrimaryPart
local doorRoot2 = door.RDoor.PrimaryPart

local PromptFromIn = script.Parent.Part.InnerPrompt.ProximityPrompt
local PromptFromOut = script.Parent.Part.OuterPrompt.ProximityPrompt

local IsDoorOpen = false

local DoorSwingOpen = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,-76.172, 0)
})
local DoorSwingOpen2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,83.865, 0)
})

local DoorSwingClose = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)
})
local DoorSwingClose2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)
})

PromptFromIn.Triggered:Connect(function()
	if not IsDoorOpen then
		DoorSwingOpen:Play()
		DoorSwingOpen2:Play()
		IsDoorOpen = true
		PromptFromIn.Enabled = false
		PromptFromOut.Enabled = false
		wait(2)
		PromptFromIn.Enabled = true
		PromptFromOut.Enabled = true
	else
		DoorSwingClose:Play()
		DoorSwingClose2:Play()
		IsDoorOpen = false
		PromptFromIn.Enabled = false
		PromptFromOut.Enabled = false
		wait(2)
		PromptFromIn.Enabled = true
		PromptFromOut.Enabled = true
	end
end)

PromptFromOut.Triggered:Connect(function()
	if not IsDoorOpen then
		DoorSwingOpen:Play()
		DoorSwingOpen2:Play()
		IsDoorOpen = true
		PromptFromIn.Enabled = false
		PromptFromOut.Enabled = false
		wait(2)
		PromptFromIn.Enabled = true
		PromptFromOut.Enabled = true
	else
		DoorSwingClose:Play()
		DoorSwingClose2:Play()
		IsDoorOpen = false
		PromptFromIn.Enabled = false
		PromptFromOut.Enabled = false
		wait(2)
		PromptFromIn.Enabled = true
		PromptFromOut.Enabled = true
	end
end)

1 Like

Other than the speed, it looks the same to me.

I think you can just increase the .59 to a 2 or 3 and it should be slower.

1 Like

But it’s not about the speed, it’s how the right door was taking a weird alternative route to complete the tween anim.

Could it be possible that the rotation was taking the shortest route possible? Apparently both doors rotated clock-wise. I have never seen this behavior before. Maybe try to change the number to a positive equivalent rotation result?

it doesn’t give me the same result of what I wanted

local TweenService = game:GetService("TweenService")
local door = script.Parent
local doorRoot = door.LDoor.PrimaryPart
local doorRoot2 = door.RDoor.PrimaryPart

local PromptFromIn = script.Parent.Part.InnerPrompt.ProximityPrompt
local PromptFromOut = script.Parent.Part.OuterPrompt.ProximityPrompt

local IsDoorOpen = false

local DoorSwingOpen = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,76.172, 0)
})
local DoorSwingOpen2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,83.865, 0)
})

local DoorSwingClose = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)
})
local DoorSwingClose2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)
})

Looks like it’s taking the shortest rotation, like Operatik said. Since it’s only happening to the one door, you can try changing the rotation of the first open tween, to match the second open tween. So -76.172 would convert to -83.865.

1 Like

this is what I got.

local TweenService = game:GetService("TweenService")
local door = script.Parent
local doorRoot = door.LDoor.PrimaryPart
local doorRoot2 = door.RDoor.PrimaryPart

local PromptFromIn = script.Parent.Part.InnerPrompt.ProximityPrompt
local PromptFromOut = script.Parent.Part.OuterPrompt.ProximityPrompt

local IsDoorOpen = false

local DoorSwingOpen = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,-76.172, 0)
})
local DoorSwingOpen2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,-83.865, 0)
})

local DoorSwingClose = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)
})
local DoorSwingClose2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)

Seems you misunderstood, sorry. What I meant was change DoorSwingOpen rotation to match DoorSwingOpen2 rotation, as before. Don’t change DoorSwingOpen2 at all. DoorSwingOpen should be Vector3.new(0,-83.865, 0) and DoorSwingOpen2 should be Vector3.new(0,83.865, 0).

1 Like

oh, my apologies I’ll grab a clip real soon.

Yeah it’s not fixing anything, I think it might be just how the tweening is trying to take a different route. I’m gonna try and see if I can make it try to not do that by rotating it a little bit to the correct direction.

local TweenService = game:GetService("TweenService")
local door = script.Parent
local doorRoot = door.LDoor.PrimaryPart
local doorRoot2 = door.RDoor.PrimaryPart

local PromptFromIn = script.Parent.Part.InnerPrompt.ProximityPrompt
local PromptFromOut = script.Parent.Part.OuterPrompt.ProximityPrompt

local IsDoorOpen = false

local DoorSwingOpen = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,-83.865, 0)
})
local DoorSwingOpen2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,83.865, 0)
})

local DoorSwingClose = TweenService:Create(doorRoot, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)
})
local DoorSwingClose2 = TweenService:Create(doorRoot2, TweenInfo.new(.59,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{
	Orientation = Vector3.new(0,180, 0)
})

I just thought that it might be because the doors are rotated differently, so maybe thats why (I doubt it tho)

1 Like

Here’s the two door’s orientation:
LDoor:


RDoor:

What about the roots of the doors, are they oriented differently?

1 Like

I encountered this problem a while ago and it worked for me; odd it didn’t work here. Sorry I couldn’t help.

1 Like

they have the same exact orientation as their separate model.

It’s okay, at least you tried though.

1 Like

Do you think you could share the model? I want to try something, as my last attempt.

1 Like

Sure here’s the file of the double door:
double door.rbxm (37.6 KB)

2 Likes

Oh wait I forgot to mention that you’ll need to set the style option to default for the proximityprompts!

I messed around, and I decided to rotate the double door model 180 degrees, and now its working for me, let me know if it works for you.

1 Like