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.
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
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.
– 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.