Hello! I am trying to make my own animations for a script for Void Script Builder (VSB) using CFrame and lerp.
This is my script by now:
local playername = "nameHere"
local plr = workspace:FindFirstChild(playername)
local actualplr = game.Players:GetPlayerFromCharacter(plr)
local RightArm = plr["Right Arm"]
local LeftArm = plr["Left Arm"]
local RightLeg = plr["Right Leg"]
local LeftLeg = plr["Left Leg"]
local Torso = plr["Torso"]
local canuse = false
print(actualplr)
local RIGHTARMLERP = Instance.new("ManualWeld")
RIGHTARMLERP.Parent = RightArm
RIGHTARMLERP.Part0 = RightArm
RIGHTARMLERP.Part1 = Torso
RIGHTARMLERP.C0 = CFrame.new(-1.5, 0, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
local LEFTARMLERP = Instance.new("ManualWeld")
LEFTARMLERP.Parent = LeftArm
LEFTARMLERP.Part0 = LeftArm
LEFTARMLERP.Part1 = Torso
LEFTARMLERP.C0 = CFrame.new(1.5, 0, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
local RIGHTLEGLERP = Instance.new("ManualWeld")
RIGHTLEGLERP.Parent = RightLeg
RIGHTLEGLERP.Part0 = RightLeg
RIGHTLEGLERP.Part1 = Torso
RIGHTLEGLERP.C0 = CFrame.new(-0.5, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
local LEFTLEGLERP = Instance.new("ManualWeld")
LEFTLEGLERP.Parent = LeftLeg
LEFTLEGLERP.Part0 = LeftLeg
LEFTLEGLERP.Part1 = Torso
LEFTLEGLERP.C0 = CFrame.new(0.5, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
for i = 0,1,.01 do
wait()
RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.5, 0.4, 0.5) * CFrame.Angles(math.rad(-90.012), math.rad(0), math.rad(0)), i)
end
for i = 0,1,.01 do
wait()
RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.5, 0, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), i)
--LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(5,0,0) * CFrame.Angles(math.rad(-90.012), math.rad(0), math.rad(0)), i)
end
end)
The script makes the player point at something and then it returns to the original position, but its too slow.
does anyone know how to make it faster?
also I saw this type of lerping and Iām curious how it works
LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-1+ 1 * math.cos(sine / 20))),.1)
and when I try to execute it it just errors (and yes I changed the variables to mine for example LS which is left shoulder to the left arm)