Each player in my game has a city. I want the camera to focus on the city using an isometric projection. So far, I have:
wait()
local player = game.Players.LocalPlayer
local localplayer = script.Parent.Parent
local angle = 0
local view = false
function center()
return (localplayer.Character and localplayer.Character:FindFirstChild'Head' and localplayer.Character.Head.Position) or Vector3.new()
end
workspace.CurrentCamera.FieldOfView = 2
workspace.CurrentCamera.CameraType = 'Scriptable'
while wait(1/60) do
workspace.CurrentCamera.CameraType = 'Scriptable'
workspace.CurrentCamera:Interpolate(
CFrame.new(center() + (CFrame.Angles(0, math.pi/4+math.pi/2*angle, 0).lookVector + Vector3.new(0, 1, 0))*1000, center()),
CFrame.new(center(), center()),
0.01
)
end
Although this works, it's sloppy. The outlines of parts flicker in-game. Is there a good way to do this without using a while loop?
|