What is the difference between using Tween or Lerp to animate a brick's movement? Also can someone give me an example code of how to use Lerp? I know how to use TweenService but not Lerp. Thanks C:
Okay, here's an example of how to use Lerp:
local p = Instance.new("Part", workspace) -- Our part to lerp. p.Anchored = true -- I just preferred local CF1 = CFrame.new() -- We need a new CFrame method (empty) to make the Transition.(Simulation of "p"'s Cframe) local CF2 = CFrame.new(10, 0, 0) -- Our goal. function Lerping(part) for i = 0, 1, .01 do -- "i" will be our alpha number, it must between 0 and 1. part.CFrame = CF1:lerp(CF2, i) -- "i" will be added every time the loop is executed again. wait() end end Lerping(p) print("Ola mundo da Lua!")