How can I wait for player humanoid to finishing turning towards object?

I have a script that tells the player to turn towards an object (A Fridge), But after a lot of searching, I couldn’t find a solution on how to make my script wait until the player is finished turning towards the object. Any help would be greatly appreciated.

Character:SetPrimaryPartCFrame(CFrame.new(Character.PrimaryPart.Position, Fridge:WaitForChild("Fridge"Position))

Can someone please help me, I have been waiting 7 hrs, Here is some more detail.

Character.Humanoid.WalkToPoint = Vector3.new(247.335, 29.998, -25.297)
	Character.Humanoid.MoveToFinished:wait()
	Character:SetPrimaryPartCFrame(CFrame.new(Character.PrimaryPart.Position, Fridge:WaitForChild("Fridge").Position))
	FridgeAnimation:Play())

Oh you fixed it, let me read the new code.

Ok, The fridge is a humanoid object and within the humanoid is a union named fridge

Capture

Basically, all I want to achieve is to make the script wait until the character turns towards the Fridge so that it can play the animation.

You could use a tween to rotate the player cframe towards the fridge and do tween.Completed:Wait() that will wait until the tween moved the character cframe to given rotation

I tried this but no luck, Any help?

local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(70)
TweenService(Character:SetPrimaryPartCFrame(CFrame.new(Character.PrimaryPart.Position, TweenInfo, {Fridge:WaitForChild("Fridge").Position}):Play()

A question where is the end? I think that’s the problem

You mean the end of the tween? Because I didn’t add one.

Ok first, here is an article about TweenService. Now, that is not how you use tweens. You could make a part that is facing toward the fridge at the angle and position you want the humanoid to do. Then tween the HumanoidRootPart of the character (The Main Part) so that the character looks at it.

local FridgeLookCFrame = (HumanoidRootPart.CFrame * CFrame.new(0,HumanoidRootPart.Size.Y/2,0)).p,Fridge.CFrame.Position)
local TweenService = game:GetService("TweenService")
local TweenSpeed = 70 --In Seconds
local TweenInfo = TweenInfo.new(TweenSpeed)
local Goal = {}
Goal.CFrame = FridgeLookCFrame
TweenService:Create(HumanoidRootPart,TweenInfo,Goal):Play()
--Replace some stuff to fix.

I’m having problems with this soulution, Let me give you the whole script

ProximityPrompt.Triggered:Connect(function(player)
	local Character = player.Character
	local PlayerHumanoid = player.Character:WaitForChild("Humanoid")
	local PushingAnimation = PlayerHumanoid:LoadAnimation(PushingAnimation)
	local PlayAnimations = coroutine.create(function()
		PushingAnimation:Play()
		MovingAnimation:Play()
	end)
	PushingAnimation.Priority = Enum.AnimationPriority.Action
	PushingAnimation.Looped = false
	Character.Humanoid.WalkToPoint = Vector3.new(247.335, 29.998, -25.297)
	Character.Humanoid.MoveToFinished:wait()
	--Character:SetPrimaryPartCFrame(CFrame.new(Character.PrimaryPart.Position, Fridge:WaitForChild("Fridge").Position))
	PlayerHumanoid.WalkSpeed = 0
	PlayerHumanoid.AutoRotate = false
	ProximityPrompt:Destroy()
	IdleAnimation:Stop()
	coroutine.resume(PlayAnimations)
	MovingAnimation.Stopped:wait()
	MovingAnimation:Stop()
	IdleAnimation2:Play()
	PlayerHumanoid.WalkSpeed = 16
	PlayerHumanoid.AutoRotate = true
	FridgeMissionComplete:Fire()
end)

– Here is an example of what this is supposed to do in video

robloxapp-20210818-1643132.wmv (1.3 MB)

– But the issue is, as you can see in the video the players animation glitches into the fridge and that is why I need to make it so that the script can wait until the player is done turning towards the fridge until it starts playing the animations.