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

When i try use lerp it comes up with an error how do i fix this?

Asked by 8 years ago
Edited by BlueTaslem 8 years ago
onepart = "0,0,5"
twopart = "5,0,0"
k = Instance.new("Part",game.Workspace.JohnJohniamm55.Torso)
k.CFrame = game.Workspace.JohnJohniamm55.Torso.CFrame * CFrame.new(5,0,0)
k.Anchored = true
wait(1)
k.Vector3 = twopart:Lerp(onepart, 1)

the error is

Workspace.Script:1: attempt to call method 'lerp' (a nil value)

0
I tested in SB JohnJohniamm55 21 — 8y
0
Error is: Workspace.Script:1: attempt to call method 'lerp' (a nil value) JohnJohniamm55 21 — 8y
0
Edited to fix formatting. BlueTaslem 18071 — 8y
1
There's a lot wrong here. BlueTaslem 18071 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

http://wiki.roblox.com/index.php?title=Lerp might help your understanding a bit more.

When you called the Lerp, there should be three values instead of 2. Three values is calling a vector three, which I assume you are trying to call. 2 values call's a quaternion lerp.Also to save you some time, instead of

game.Workspace.JohnJohniamm55.Torso.CFrame, make a variable named "Player" and write Player = game.Players.LocalPlayer. next where "game.Workspace.JohnJohniamm55.Torso.CFrame" is write "Player.Torso.CFrame". This will save you a lot of time. Be sure to take a look at the website if you still don't understand your problem

Ad

Answer this question