Advertisement
StefanBashkir

Swing part on axis

May 28th, 2014
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. local increment = .05 -- best to keep it to a 5-base of 1(0)-base increment
  2.  
  3. function RunAnimation(p)
  4.     local p = p or script.Parent
  5.     local rightframe = p.CFrame + p.CFrame:vectorToWorldSpace( Vector3.new(1,0,0) * p.Size.X/2 )
  6.     for i = 0, math.pi/2, .05 do
  7.         wait()
  8.         local newframe = rightframe * (CFrame.Angles(0, -i, 0) * CFrame.new(p.Size.X/-2,0,0))
  9.         p.CFrame = newframe
  10.     end
  11. end
  12.  
  13. RunAnimation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement