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

Previous Thread :: Next Thread 
djboy is not online. djboy
Joined: 16 Mar 2008
Total Posts: 794
21 Apr 2015 11:09 PM
So im trying to make the object move to the position VIA CFrame.. But whats happening it does not rotate so i tryed rotating it with the Rotation property since we HAVE to use position in lerp. Help?


function Lerp(obj, pos,pos2)
opos = obj.Position
for i = 0 , 1, 1 do
game:GetService("RunService").RenderStepped:wait()
obj.CFrame = CFrame.new(opos:lerp(pos, i))
obj.Rotation = opos:lerp(pos2,i)
end
end

for i,v in pairs(game.Workspace.PreviewBin:GetChildren()) do
Lerp(v, v.Vector.Value,v.Vector2.Value)
end
Report Abuse
BossfightX is not online. BossfightX
Joined: 06 Feb 2010
Total Posts: 2962
21 Apr 2015 11:32 PM
So what you are asking for is to move a part using CFrame, but you want to keep it's current rotation?
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
21 Apr 2015 11:47 PM
Wot.
Report Abuse
2NQ is not online. 2NQ
Joined: 18 Apr 2015
Total Posts: 81
21 Apr 2015 11:50 PM
function Lerp(obj, pos,pos2)
opos = obj.Position
orot = obj.Rotation;
local rot_mat = {orot.x,orot.y,orot.z}
for i = 0 , 1, 1 do
game:GetService("RunService").RenderStepped:wait()
obj.CFrame = CFrame.new(opos:lerp(pos, i)) * CFrame.Angles(unpack(rot_mat));
end
end

for i,v in pairs(game.Workspace.PreviewBin:GetChildren()) do
Lerp(v, v.Vector.Value,v.Vector2.Value)
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