https://streamable.com/0xlusv
I’m trying to bring the player into position infront of the heavy bag and face the character towards to bag before locking them in place. I tried doing this with tweens but as you can see, it’s incredibly glitchy in the clip.
The script(Excerpt):
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local FrontPad = PromptObject.Parent.Parent.FrontPad
local Bag = workspace:FindFirstChild("PunchingBag")
local ProximityWall = Bag.ProximityWall
local Info = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0)
local Goal1 = {
CFrame = FrontPad.CFrame
}
local Goal2 = {
CFrame = CFrame.lookAt(HumanoidRootPart.Position,ProximityWall.Position)
}
local Tween1 = TweenService:Create(HumanoidRootPart,Info,Goal1)
local Tween2 = TweenService:Create(HumanoidRootPart,Info,Goal2)
HumanoidRootPart.Anchored = true
Tween1:Play()
Tween1.Completed:Wait()
Tween2:Play()
Tween2.Completed:Wait()
HumanoidRootPart.Anchored = false
What’s causing this glitchiness and how can I fix this? Or is there a better way to doing this? With Bodymovers perhaps?