How would I make a Live Camera?

Hi! I just want to do a simple Live Camera GUI, and maybe move around the map. How would I do this?

Well what you could do is make a loop inside a local script and connect the CurrentCamera to a part’s CFrame:

local camera = workspace.CurrentCamera
local cameraPart = workspace. --The part for the camera

while wait() do
      camera.CFrame = cameraPart.CFrame
end

And then you can just use a TextButton or whatever to start/ stop the loop.

For moving the camera you can just make a looping Tween via TweenService: TweenService | Documentation - Roblox Creator Hub

What GUI Item would this go into for display?

Well we could make a ScreenGui in StarterGui and then just add a TextButton or something and when they click it, it starts the Camera Loop

Here is the API Documentation on TextButton: TextButton | Documentation - Roblox Creator Hub


It should have the cam automatic, destroying when the GUI closes.

You should probably use renderstepped instead:

local camera = workspace.CurrentCamera
local cameraPart = workspace. --The part for the camera
local RunService = game:GetService("RunService")

RunService.RenderStepped:Connect(function()
      camera.CFrame = cameraPart.CFrame
end)

Yes that is a better option. Thanks @kosava

Ok so when they join the game you want them to Automatically be looking at the map through the camera?

Yes. Also note there is a loading phase.

local frame = script.Parent.Frame
local base = frame.Base
local bar = base.Bar
local indicator = base.Indicator
local jpg = base.Bar.ImageLabel
local queue = game.ContentProvider.RequestQueueSize

game.ReplicatedFirst:RemoveDefaultLoadingScreen()

while wait() do
	indicator.Text = "Loading... (" .. queue .. ")"
	bar.Size = UDim2.new(1/queue, 0, 1, 0)
	jpg.Size = UDim2.new(1/queue, 0, 1, 0)
	wait (4)
	if queue == 0 then
		indicator.Text = "Assets Loaded!"
		bar.Size = UDim2.new(1, 0, 1, 0)
		jpg.Size = UDim2.new(1, 0, 1, 0)
		wait(1)
		frame:TweenPosition(UDim2.new(0, 0, 1, 0))
	end
end

Alright. Just add this somewhere in the loading phase:

local camera = workspace.CurrentCamera

local cameraPart = workspace:WaitForChild("") -- Add The Camera Part There

repeat wait()

camera.CameraType = Enum.CameraType.Scriptable

until camera.CameraType == Enum.CameraType.Scriptable

camera.CFrame = cameraPart.CFrame

And then once the player presses “Play” you just make the camera type back to “Custom”


I have it in the GUI as a LocalScript.
What next to make it show?

I don’t understand what you mean by

NVM, it’s working. I dont know what I was doing wrong in the first place.

Alright Cool, glad I could help!

1 Like


Just in case you were wondering the final product.

2 Likes

I guess you could try and do something like this:
Put this script in a TextButton
'wait(0.1)
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded
local hum = char:WaitForChild(“Humanoid”) or char:GetFirstChildOfClass(“Humanoid”)
local camera = workspace.CurrentCamera
local liveCamera = workspace. --The part you want the camera to focus on
local ts = game:GetService(“TweenService”)
local tsInfo = TweenInfo.new(
20, --Change this to the length you want
Enum.EasingStyle.Liner, --Change this to the tween style you want
Enum.EasingDirection.Out, --Change this to In or Out or InOut
1, --Change this to how many times you want it to repeat the tween
true, --Change this to true if you want it to do the tween in reverse
0, --Change this to the delay you want
)
local camGoal =
{
Position = Vector3.new(0,0,0) --Change the vector
–Add more things if you want
}
local moveLivePart = ts:Crate(liveCamera, tsInfo, camGoal)

script.Parent.MouseClick1Down:Connect(function()
ts:Play()
camera.CameraType = “Scriptable” --If this doesn’t work try using “Fixed”
camera.Focus = cameraPart.CFrame
end)
script.Parent.MouseClick1Down:Connect(function() --If player clicks again then
ts:Stop
camera.CameraType = “Classic”
camera.Focus = hum
end)

This is fixed and idrc, but that is broken.

I took too much time typing this code and didn’t notice that you already found a solution.

lol.

I worked for me:
Pic

Since nobody has told you and I think you want it to follow like a circle you can do is abstract from the unit circle, see my tutorial here where now we turn it into an ellipse, multiply the sine with our semi minor axis and our cosine with the semi major. If you just want it to be a circle I show the code in the video.

I did the math in desmos for you, c is the x component and k is the z.