Table hiding animations bugging out

are you sure the spinning is not part of the animation? who made the animation

I made the animation, and no for sure its not a part of the animation. Proof:

i just realized in your youtube video, your character gets dragged and instead is facing the opposite way!

Yeah, i dont know how to fix this, i tried doing it with the tween using the Orientation property, but it just wont do anything

maybe this will help you

and also i found this post but idk if this will help Tween CFrame orientation - #3 by StudioNovaHolder

I fixed the problem just by making the parts orientation -90 degrees on the y axis, ill just leave the spinny thing there as i really dont know how to fix it. So now moving on to the exit script, the idle anim will keep on playing and the exit animation doesnt play at all.

well, instead of 2 scripts, cant you make it into 1?

I can try. Here it is:

 local ts = game:GetService("TweenService")
script.Parent.HidePrompt.Triggered:Connect(function(plr)
	local idle = plr.Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Parent.Idle)
	local enter = plr.Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Parent.Enter)
	local exit = plr.Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Parent.Exit)
	print("triggered")
	plr.Character.HumanoidRootPart.Anchored = true
	script.Parent.Parent.In:Play()
	local tween = ts:Create(plr.Character.HumanoidRootPart,TweenInfo.new(0.5,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out),{CFrame = script.Parent.Parent.CFrame + Vector3.new(0,1,0)})tween:Play()
	wait(0.5)
	print("Tween completed!")
	plr.Character:SetAttribute("hiding",true)
	script.Parent.Parent.Parent.IsPlayerInLocker.Value = 1
	script.Parent.Enabled = false
	script.Parent.Parent.ExitPrompt.Enabled = false
	enter:Play()
	print("Enter animation playing.")
	enter.Ended:Wait()
	print("Enter animation ended, idle should be playing now!")
	idle:Play()
end)
script.Parent.ExitPrompt.Triggered:Connect(function(plr)
	local idle = plr.Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Parent.Idle)
	local enter = plr.Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Parent.Enter)
	local exit = plr.Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Parent.Exit)
	print("triggered")
	script.Parent.Parent.Out:Play()
	idle:Stop()
	local tween = ts:Create(plr.Character.HumanoidRootPart,TweenInfo.new(0.5,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out),{CFrame = script.Parent.Parent.CFrame + Vector3.new(0,1,0)})tween:Play()
	wait(0.5)
	--plr.Character.HumanoidRootPart.CFrame = script.Parent.Parent.Parent.ExitCFRAME.CFrame -- i need to add parts
	script.Parent.Parent.Parent.IsPlayerInLocker.Value = 0
	--local tween2 = ts:Create(script.Parent.Parent,TweenInfo.new(0.5,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{CFrame = script.Parent.Parent.Parent.DoorClosed.CFrame})tween2:Play()
	plr.Character.HumanoidRootPart.Anchored = false
	plr.Character:SetAttribute("hiding",false)
	script.Parent.Enabled = false
	script.Parent.Parent.HidePrompt.Enabled = true
	exit:Play()

end)

Wait hold on let me fix some bugs

can you load the animations outside of the events? that way it will be more convinient

Yeah but the player wont be a variable so im gonna have to wrap everything in a game.Players.Playeradded:connect(function() script

thats why you use animations on local, but that works too

actually do chacracter.added, the server will start before the character joins

not this again :cold_sweat: :disappointed_relieved: :cold_sweat:
image

Current script btw:

local ts = game:GetService("TweenService")
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
	local idle = char:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Idle)
	local enter = char:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Enter)
	local exit = char:WaitForChild("Humanoid"):LoadAnimation(script.Parent.Exit)
		script.Parent.HidePrompt.Triggered:Connect(function()
			print("triggered")
			plr.Character.HumanoidRootPart.Anchored = true
			script.Parent.In:Play()
			local tween = ts:Create(plr.Character.HumanoidRootPart,TweenInfo.new(0.5,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out),{CFrame = script.Parent.Parent.CFrame + Vector3.new(0,1,0)})tween:Play()
			wait(0.5)
			print("Tween completed!")
			plr.Character:SetAttribute("hiding",true)
			script.Parent.Parent.IsPlayerInLocker.Value = 1
			script.Parent.HidePrompt.Enabled = false
			script.Parent.ExitPrompt.Enabled = false
			enter:Play()
			print("Enter animation playing.")
			enter.Ended:Wait()
			print("Enter animation ended, idle should be playing now!")
			idle:Play()
		end)
		script.Parent.ExitPrompt.Triggered:Connect(function()
			print("triggered")
			script.Parent.Out:Play()
			idle:Stop()
			local tween = ts:Create(plr.Character.HumanoidRootPart,TweenInfo.new(0.5,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out),{CFrame = script.Parent.Parent.CFrame + Vector3.new(0,1,0)})tween:Play()
			wait(0.5)
			--plr.Character.HumanoidRootPart.CFrame = script.Parent.Parent.Parent.ExitCFRAME.CFrame -- i need to add parts
			script.Parent.Parent.IsPlayerInLocker.Value = 0
			--local tween2 = ts:Create(script.Parent.Parent,TweenInfo.new(0.5,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{CFrame = script.Parent.Parent.Parent.DoorClosed.CFrame})tween2:Play()
			plr.Character.HumanoidRootPart.Anchored = false
			plr.Character:SetAttribute("hiding",false)
			script.Parent.ExitPrompt.Enabled = false
			script.Parent.HidePrompt.Enabled = true
			exit:Play()
		end)
	end)
end)

hmm, try adding a wait before loading all 3 animations

and also i dont know why you have idlestop before wait0.5, it wont really look well

This worked, Thank you so much!

np man, sorry if i was slow lol