local TweenService = game:GetService("TweenService")
local cam = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
-- Ensure the camera type is Scriptable for custom manipulation
cam.CameraType = Enum.CameraType.Scriptable
-- Function to rotate the camera around the player
local function rotateCamera(duration)
local initialCFrame = cam.CFrame
local goalCFrame = initialCFrame * CFrame.Angles(0, math.rad(360), 0)
local tween = TweenService:Create(cam, TweenInfo.new(duration), {CFrame = goalCFrame})
tween:Play()
end
-- Set the camera position relative to the player's root part
cam.CFrame = CFrame.new(rootPart.Position + Vector3.new(0, 5, 10), rootPart.Position)
-- Rotate the camera around the player over 10 seconds
rotateCamera(10)
local TweenService = game:GetService("TweenService")
local cam = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
-- Ensure the camera type is Scriptable for custom manipulation
cam.CameraType = Enum.CameraType.Scriptable
-- Function to rotate the camera around the player
local function rotateCamera(duration)
local initialCFrame = cam.CFrame
local goalCFrame = initialCFrame * CFrame.Angles(0, math.rad(360), 0)
local tween = TweenService:Create(cam, TweenInfo.new(duration), {CFrame = goalCFrame})
tween:Play()
end
-- Function to continuously update the camera's position relative to the player's root part
local function updateCameraPosition()
local runService = game:GetService("RunService")
runService.RenderStepped:Connect(function()
cam.CFrame = CFrame.new(rootPart.Position + Vector3.new(0, 5, 10), rootPart.Position)
end)
end
-- Set the initial camera position relative to the player's root part
cam.CFrame = CFrame.new(rootPart.Position + Vector3.new(0, 5, 10), rootPart.Position)
-- Start rotating the camera around the player over 10 seconds
rotateCamera(10)
-- Continuously update the camera's position relative to the player's root part
updateCameraPosition()
local cam = workspace.CurrentCamera
local TweenService = game:GetService("TweenService")
-- Ensure the camera is in custom mode
cam.CameraType = Enum.CameraType.Custom
-- Define the TweenInfo
local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)
-- Create the rotation CFrame
local rotation = CFrame.Angles(0, math.rad(360), 0)
-- Tween the camera
local tween = TweenService:Create(cam, tweenInfo, {CFrame = cam.CFrame * rotation})
-- Play the tween
tween:Play()