How do I code in a camera position change for players during intro sequence

I’m trying to make a GUI intro for my new game, and I have never messed with actual player camera position changes except for one time, which actually was just an experimentation that failed miserably to meet my expectations (I knew how to change the position, but in a very limited fashion, and now I don’t even remember any part of that situation anymore). If anyone could help me out here I’d appreciate it greatly. Preferably if possible, a script camera focus on an invisible part whilst rotating around it (To give a bird’s eye view of the whole game).

2 Likes

You can attach the camera to a brick and tween that brick around if you want it moving. If this is what your looking for i can give script

That actually would be better than just a regular distanced camera rotation. Can you give me an example?

The Camera is almost like a movable object, it has a CFrame property, and you can do a lot of stuff with it. I suggest searching more about it. You have two options:

  1. Just constanly rotate the camera, manipulating its cframe
  2. or set the Camera.Subject property to an invisible part, and rotate that part.

I suggest manually changing the CFrame of the camera, by adding a bit to its rotation each frame using RunService:BindToRenderStep(), search more about :BindToRenderStep() as well. Using this would better, because when a button is clicked to stop the rotation, simply do :UnbindToRenderStep(). Info.

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local RunService = game:GetService("RunService")

local function Rotate()
    camera.CFrame = camera.CFrame * CFrame.Angles(math.rad(0.5),0,0) --this is basically adding 0.5 to the camera's rotation every time this is called
end

RunService:BindToRenderStep("Rotating", 1000, Rotate) --I recommend searching more about this, Rotating is a name, it can be anything else, and 1000 is the priority

--RunService:UnbindToRenderStep --this is to stop it
1 Like

Actually! Roblox has a template that does the exact thing you want! The FFA Template when you create a new place inside the starterplayer > starter place script > displayscript!

script. This should work but im cutting from a script

	local possiblePoints = {}
	table.insert(possiblePoints, Vector3.new(0,50,0))
	
	local focalPoint = possiblePoints[math.random(#possiblePoints)]
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.Focus = CFrame.new(focalPoint)

	RunService:BindToRenderStep('IntermissionRotate', Enum.RenderPriority.Camera.Value, function()
		local cameraPosition = focalPoint + Vector3.new(50 * math.cos(angle), 20, 50 * math.sin(angle))
		Camera.CoordinateFrame = CFrame.new(cameraPosition, focalPoint)
		angle = angle + math.rad(.25)
	end)

Here is your simple attach the camera to a brick code

local Camera = workspace.CurrentCamera


repeat wait(1)
	Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
	Camera.CFrame = game.Workspace.MainCamera.CFrame -- This is the part CFrame

I’ve tried putting this down with adding the necessary variables. However, no error is in the output when I try this but the player camera doesnt change. Any reason why?

This has to be done in a local script. You are getting the players current camera