So, this camera script is a custom one.
Things script uses:
- a folder in replicatedstorage named CameraObject with the camera part
- a folder in workspace where the camera part gets transfered when the script is activated which is named CameraFolder
Its basically a dungeon crawler camera, and I want to deactivate it using another script, how would I do this?
The script is below which activates the camera for the dungeon crawler camera:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild('HumanoidRootPart')
local camera = workspace.Camera
local folder = workspace.CameraFolder
local part = game.ReplicatedStorage.CameraObject.CameraPart
camera.CameraType = Enum.CameraType.Scriptable
local cameraPart = part:Clone()
cameraPart.Parent = folder
camera.CameraSubject = cameraPart
cameraPart.Position = rootPart.Position + Vector3.new(20,25,20)
camera.CFrame = cameraPart.CFrame + Vector3.new(-1,1,-1)
game["Run Service"].Heartbeat:Connect(function()
cameraPart.Position = rootPart.Position + Vector3.new(20,25,20)
camera.CFrame = camera.CFrame:Lerp(cameraPart.CFrame + Vector3.new(-1,1,-1), 0.5)
end)