Whitemambaa

TweenLib example

Jan 30th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. --Initialize tween:
  2. TweenLib.newCFrameTween("test",--Tween name
  3.     CFrame.new(),--Initial value
  4.     function(cf) part.CFrame=cf end,--An optional function to update the items related to the tween, it's only purpose is to to be called by TweenLib.updateCFrameTweens
  5.     1--A number or function that specifies how long the tween should take, defaults to 1 if nothing is given.
  6. )
  7.  
  8. --Tween to a CFrame:
  9. TweenLib.CFrameTween.test=CFrame.Angles(1,2,3)
  10.  
  11. --Animate the tween(s) in the main loop:
  12. while true do
  13.     TweenLib.updateCFrameTweens(tick())--call the 'update function' used in the initialization
  14.     wait()
  15. end
  16.  
  17. --Alternatively, you can obtain a freshly calculated value every time you index the table:
  18. part.CFrame=TweenLib.CFrameTween.test
Advertisement
Add Comment
Please, Sign In to add comment