Camera Rotation

Hi, I would like to know what method I can use to achieve an effect where, picture this, there’s an house, and in the lobby screen the camera just goes in a 360 orientation around the house constantly just viewing and facing the house,

how can I achieve this camera manipulation effect ?

Examples:

This NEW Roblox Anime Fighting Game Releases THIS WEEK! - YouTube ( check 2:21)

I would use this method for 360 rotations. :point_down: instead of viewport frames you would just make it use Workspace.CurrentCamera

Oh I’m not trying to rotate model, I’m trying to 360 view a players camera like in one of those lobbies, check the video I sent in this forum post please,
Thanks for reply though

You would want to set the player camera cframe to a part, and make the part rotate 360 degrees

I made this quick simple script that will rotate the camera in a circle around a specific target part. You can customize the variables at the top to your liking, and expand the script to your own needs. For the purposes of an example, the script rotates the camera for only 5 seconds and then disables it, but you can change this. This should be a LocalScript inside StarterPlayerScripts:

--customize the variables directly below
local targetPart = workspace:WaitForChild("Target") --target part to rotate around
local speed = 0.25 --full rotations per second around target
local distance = 50 --stud offset distance from target
local height = 25 --stud offset height from target

local currentAngle = 0
local tau = math.pi*2

local function UpdateCamera(dt)
	local cam = workspace.CurrentCamera
	if cam.CameraType ~= Enum.CameraType.Scriptable then
		cam.CameraType = Enum.CameraType.Scriptable
	end
	currentAngle += speed * tau * dt
	local offset = Vector3.new(distance * math.sin(currentAngle), height, distance * math.cos(currentAngle))
	cam.CFrame = CFrame.lookAt(targetPart.Position + offset, targetPart.Position)
	cam.Focus = targetPart.CFrame
end

local function EnableLobbyCamera()
	local cam = workspace.CurrentCamera
	cam.CameraType = Enum.CameraType.Scriptable
	game:GetService("RunService"):BindToRenderStep("LobbyCamera", Enum.RenderPriority.Camera.Value-1, UpdateCamera)
end

local function DisableLobbyCamera()
	local cam = workspace.CurrentCamera
	game:GetService("RunService"):UnbindFromRenderStep("LobbyCamera")
	cam.CameraType = Enum.CameraType.Custom
end

local player = game:GetService("Players").LocalPlayer
if not player.Character then
	player.CharacterAdded:Wait()
end

EnableLobbyCamera()
task.wait(10)
DisableLobbyCamera()
3 Likes

https://developer.roblox.com/en-us/articles/Camera-manipulation

use a renderstepped loop + CFrame.angles on a camera cframe