Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I remove this smoothing animation?

Asked by 3 years ago

Through the Developer Forum, I found the answer I was looking for. But I had a problem: It was smoothing out whenever it moved. I didn't want this as I'm coding this for an NPC. Can anyone change it back so it snaps instead of gliding? Thanks!

                        local HeadPosition = script.Parent.Head.CFrame.Position
                        local TorsoLookVector = script.Parent.UpperTorso.CFrame.LookVector
                        local Point = newenemy.HumanoidRootPart.Position
                        local Difference = script.Parent.HumanoidRootPart.CFrame.Y - newenemy.Torso.CFrame.Y
                        local Distance = (script.Parent.HumanoidRootPart.CFrame.Position - Point).magnitude
                        script.Parent.UpperTorso.Waist.C0 = script.Parent.UpperTorso.Waist.C0:lerp(c0orgin * CFrame.Angles(-(math.atan(Difference / Distance) * 0.5), (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 0.5, 0), 0.5 / 2)

Answer this question