1 |
I was trying to make an intro thing, and make the camera move around. here is my script. Some reason it didn't work.
01 | c = game.Workspace.CurrentCamera |
02 | pos 1 = CFrame.new( 1 , 1 , 1 ) |
03 | pos 2 = CFrame.New( 2 , 3 , 2 ) |
04 |
05 | function TweenCam(co, fo, step) |
06 | c 1 ,f 1 = c.CoordinateFrame, c.Focus |
07 | for 1 = - 90 , 90 ,step do |
08 | r = math.cos(math.rad(i+ 1 )- 1 / 2 ) |
09 | c.CoordinateFrame = CFrame.new(fo.p:lerp(f 1 , r)) |
10 | end |
11 | end |
12 |
13 | wait( 1 ) |
14 | TweemCam(pos 1 , pos 2 , 1 ) |
Please help me and say if i did anything wrong.
You did for 1=90,90,stepdo instead of for i=90,90stepdo
function TweenCam(co, fo, step) c1,f1 = c.CoordinateFrame, c.Focus for i=-90,90,step do r = math.cos(math.rad(i+1)-1/2) c.CoordinateFrame=CFrame.new(fo.p:lerp(f1, r)) end end
I think the rest should work.