Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Camera Manipulation


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.

3 comments

0

Please use the code button (Lua symbol in the editor) to make your Lua easier to read.

0

Seems MNN already answered it.

0

Thanks, sweetpea11fir, but it didnt seem to work.

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.