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

Tried lerping CFrame and it didn't work. Can someone explain what I did wrong?

Asked by 6 years ago

So I'm learning to lerp CFrame and I'm having a bit of trouble understanding it. I have an idea of how lerping works with moving from a start point to a mid point then to an end point. And I know that C0 is angles. So my question is what am I putting in the parentheses? Do I put the angle of the block? And if that's the case how do I distinguish between the x,y,z axis? I already tried putting the x-position in the start point. Then the y-position in the mid point and the z-position in the end point. It didn't work, So I'm assuming that you don't input it like that. I have a script to reference but I'm not sure what I'm doing wrong, would appreciate any help. Example of what I've tried. Needless to say it didn't work. Would appreciate any help.

What I tired
local p = game.Players.LocalPlayer
local char = p.Character
local rad = math.rad
local hum = char.Humanoid

local LeftUpperArm = char.LeftUpperArm
local LeftShoulder = char.LeftUpperArm.LeftShoulder
local LeftLowerArm = char.LeftLowerArm
local LeftElbow = char.LeftLowerArm.LeftElbow
local LeftWrist = char.LeftHand.LeftWrist

local LeftUpperLeg = char.LeftUpperLeg
local LeftHip = char.LeftUpperLeg.LeftHip
local LeftLowerLeg = char.LeftLowerLeg
local LeftKnee = char.LeftLowerLeg.LeftKnee

local RightUpperArm = char.RightUpperArm
local RightShoulder = char.RightUpperArm.RightShoulder
local RightLowerArm = char.RightLowerArm
local RightElbow = char.RightLowerArm.RightElbow

local RightUpperLeg = char.RightUpperLeg
local RightHip = char.RightUpperLeg.RightHip
local RightLowerLeg = char.RightLowerLeg
local RightKnee = char.RightLowerLeg.RightKnee

local UpperTorso = char.UpperTorso
local LowerTorso = char.LowerTorso
local Root = char.LowerTorso.Root

local Head = char.Head
local Neck = char.Head.Neck
local RootPart = char.HumanoidRootPart
local LeftHand = char.LeftHand
local RightHand = char.RightHand
local LeftFoot = char.LeftFoot
local RightFoot = char.RightFoot

local v3 = Vector3.new
local ns = NumberSequence.new
local new = Instance.new
local nr = NumberRange.new
local bc =BrickColor.new
local UpperTorso = char.UpperTorso
local Waist = char.UpperTorso.Waist
for i = 1,100 do
LeftShoulder.C0 = LeftShoulder.C0:lerp(CFrame.new(LeftShoulder.C0.p)*CFrame.Angles(rad(6.945),rad
(3.607),rad(3.936)))
LeftElbow.C0 = LeftElbow.C0:lerp(CFrame.new(LeftElbow.C0.p)*CFrame.Angles(rad(6.829),rad(3.665)
,rad(4.251)))
LeftWrist.C0 = LeftWrist.C0:lerp(CFrame.new(LeftWrist.C0.p)*CFrame.Angles(rad(6.512),rad(4.133),rad
(4.663)))
RightShoulder.C0 = RightShoulder.C0:lerp(CFrame.new(RightShoulder.C0.p)*CFrame.Angles(rad(3.95),rad
(3.681),rad(3.937)))
RightElbow.C0 = RightElbow.C0:lerp(CFrame.new(RightElbow.C0.p)*CFrame.Angles(rad(4.035),rad
(3.747),rad(4.281)))
  wait()
end
0
lerp requires the alpha value. This is a number between 0 and 1 that acts as a % of the distance between the 2 values. lukeb50 631 — 6y

Answer this question