Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Camera Manipulation

Asked by 10 years ago

I was trying to make an intro thing, and make the camera move around. here is my script. Some reason it didn't work.

c = game.Workspace.CurrentCamera
pos1 = CFrame.new(1,1,1)
pos2 = CFrame.New(2,3,2)

function TweenCam(co, fo, step)
    c1,f1 = c.CoordinateFrame, c.Focus 
    for 1=-90,90,step do
        r = math.cos(math.rad(i+1)-1/2)
        c.CoordinateFrame=CFrame.new(fo.p:lerp(f1, r))
    end
end

wait(1)
TweemCam(pos1, pos2, 1)

Please help me and say if i did anything wrong.

0
Please use the code button (Lua symbol in the editor) to make your Lua easier to read. Freemium 110 — 10y
0
Seems MNN already answered it. TheMyrco 375 — 10y
0
Thanks, sweetpea11fir, but it didnt seem to work. BreBreGaming 10 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

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.

Ad

Answer this question