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 
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
18 Jul 2015 12:37 AM
for rot = 0, 1, 0.1 do
print("rotating progress: "..rot)
cam.CoordinateFrame = cam.CoordinateFrame:lerp(cam.CoordinateFrame * CFrame.Angles(0, math.rad(-90), 0), rot)
wait()
end

this works, but how could i make the camera rotate more slowly, without sacrificing a smooth rotation?
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
18 Jul 2015 12:40 AM
wait() basically waits the least possible amount of time your client can replicate on the ROBLOX sandbox, unless you use some other method then you wont make the for loop faster

ʏᴏᴜ ᴛʜᴏᴜɢʜᴛ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴅʀᴀɢ ᴍᴇ ᴛᴏ ᴛʜᴇ ʙᴏᴛᴛᴏᴍ ᴏғ ᴛʜᴇ ʟᴀᴋᴇ sᴏ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴇᴀᴛ ᴍᴇ ʟᴀᴛᴇʀ... ᴡᴇʟʟ ɢᴜᴇss ᴡʜᴀᴛ ᴘᴜɴᴋ... ɪᴍ ᴀ ғɪsʜ... ᴡɪᴛʜ ʟᴇɢs
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
18 Jul 2015 12:41 AM
I reccomend messing around with the values, or try doing something to the loop so yeah you can do tht

ʏᴏᴜ ᴛʜᴏᴜɢʜᴛ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴅʀᴀɢ ᴍᴇ ᴛᴏ ᴛʜᴇ ʙᴏᴛᴛᴏᴍ ᴏғ ᴛʜᴇ ʟᴀᴋᴇ sᴏ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴇᴀᴛ ᴍᴇ ʟᴀᴛᴇʀ... ᴡᴇʟʟ ɢᴜᴇss ᴡʜᴀᴛ ᴘᴜɴᴋ... ɪᴍ ᴀ ғɪsʜ... ᴡɪᴛʜ ʟᴇɢs
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
18 Jul 2015 12:41 AM
Change the increment.

local seconds = 3

for rot = 0, 1, 1/(seconds*30) do
print("rotating progress: "..rot)
cam.CoordinateFrame = cam.CoordinateFrame:lerp(cam.CoordinateFrame * CFrame.Angles(0, math.rad(-90), 0), rot)
wait()
end
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
18 Jul 2015 12:46 AM
if i wait any higher than wait() without any arguments, it gets choppy
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
18 Jul 2015 12:46 AM
o dang i posted that without refreshing the page

thanks jimmy
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
18 Jul 2015 12:48 AM
Also here's something you might want to check: 'cam.CoordinateFrame = cam.CoordinateFrame:lerp(cam.CoordinateFrame * CFrame.Angles(0, math.rad(-90), 0), rot)'

The CFrame of 'cam' will change every single time the code executes, so you might want to set a static CFrame for it's start.

local seconds = 3

local c = cam.CoordinateFrame

for rot = 0, 1, 1/(seconds*30) do
print("rotating progress: "..rot)
cam.CoordinateFrame = cam.CoordinateFrame:lerp(c * CFrame.Angles(0, math.rad(-90), 0), rot)
wait()
end
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
18 Jul 2015 12:53 AM
thanks for all of the help!
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