Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

4 comments

0

I tested in SB

0

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

0

Edited to fix formatting.

1

There's a lot wrong here.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.