generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Lerp CFrame

Previous Thread :: Next Thread 
VineyardVine is not online. VineyardVine
Joined: 20 Nov 2010
Total Posts: 904
07 Apr 2016 08:49 PM
Trying to get the grasp of lerp animations. For some reason this dose not do anything


x=CFrame.new(1.43356323, 1.26202965, -1.17901993, -0.533497512, 0.124998942, -0.836513937, -0.124999106, 0.9665066, 0.224143326, 0.836513937, 0.224143401, -0.500004113)



wait(3)
while wait(.1) do
game.Workspace.Head.Left_1.C0 = game.Workspace.Head.Left_1.C0:lerp(x,.02)
end

I got the cframe from moving a duplicate of the piece that I was animating and used basepart.CFrame:toObjectSpace(newpieceCFrame)

Cant seem to get anything happening
Report Abuse
VineyardVine is not online. VineyardVine
Joined: 20 Nov 2010
Total Posts: 904
07 Apr 2016 09:38 PM
Humpddy Bumpddy
Report Abuse
VineyardVine is not online. VineyardVine
Joined: 20 Nov 2010
Total Posts: 904
07 Apr 2016 11:06 PM
b2
Report Abuse
HexaDecival is not online. HexaDecival
Joined: 13 Dec 2015
Total Posts: 144
08 Apr 2016 12:42 AM
You need a step for it to Lerp, there are two methods I know of

A. for loop (Inefficient, I don't recommend it)

local Step = 0.1
for Iteration = 0, 1, Step do
game:GetService("RunService").RenderStepped:wait()
Part.CFrame = Part:Lerp(Target,Iteration)
end

B. delta timing in a loop (More efficient and compensates for frame rate drops)

local delta = tick()
local Speed = 8

while game:GetService("RunService").RenderStepped:wait() do
Part.CFrame = Part:Lerp(Target,(tick()-delta)*Speed)
delta = tick()
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image