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

How to lerp rotation?

Asked by 8 years ago

I know you can use Cframe:lerp() for moving a part to another point but is there a way you can lerp the rotation of a brick?

0
What are you exactly trying to do? Because if you're just rotating on one axis continually, why not just do while wait() do brick.CFrame = brick.CFrame * CFrame.Angles(0,math.rad(1),0) end M39a9am3R 3210 — 8y

3 answers

Log in to vote
1
Answered by 8 years ago

here is an example of rotating with angels. all you have to do is use CFrame:lerp(CFrame.new()*CFrame.Angels()) so try ..

local p = Instance.new("Part", workspace)
p.Anchored = true
wait(3)
for i = 0, 1,0.0001 do -- for smooth cframing
p.CFrame = p.CFrame:lerp(p.CFrame * CFrame.Angles(0,0,math.rad(45)) , i)
--you can only use the CFram:lerp() method when it is the cframe of an object
wait(0.01)
end
0
Thanks, btw the lerp method has a 3rd parameter for time so I wont need to use the for loop. spoderman909 5 — 8y
0
that must be new, huh Angels_Develop 52 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

Heres a not so good 1 i made a while back Just Look at them its very easy to use IGNORE THE THOUSANDS OF LINES

Log in to vote
-1
Answered by 8 years ago

may i see the code?

0
There isnt any code, all I want to do is just smoothly animate a rotation, using lerp if possible. spoderman909 5 — 8y
0
aha wiktorwiktor12 0 — 8y
0
well what i would do is make it into like a humanoid with all the body parts and script a script for custom animation and make one with the roblox animation editor wiktorwiktor12 0 — 8y
0
Just for one rotation? I meant like one part rotating smoothly, for example a door. spoderman909 5 — 8y
0
no not an entire just make like one left arm because with no arms and leg and the object would be needed to be named head and then animated wiktorwiktor12 0 — 8y

Answer this question