function moveCrane(route) for i = 1, #route do for a = 0, 1, 0.005 do crane.Position = crane.Position:Lerp(route[i].Position, a) wait() print(a) end end end
I don't see what I'm doing wrong here, I want the block called "crane" to have it's position lerped to the specified one. It works, but not fully. Here's what I mean by that:
The part moves as you would expect from doing this, but, when the part gets to the specified location, 'a' is only at ~0.25 or something like that. To me, 'a' being at 0.25 would mean that the part would be one quarter of the way there, not already there. Maybe I'm doing something wrong. Any help is appreciated.
for anyone wondering, i fixed it with this:
function moveCrane(route) for i = 1, #route do local startPos = crane.Position for a = 0, 1, 0.1 do crane.Position = startPos:Lerp(route[i].Position, a) wait() --print(a) end end end