Locking camera to a part

how would i manipulate the camera so its locked onto a part

2 Likes

You can change the CameraSubject via a localscript.

Like this. Use a renderstepped function to position the camera’s cframe every frame.

local cam = workspace.CurrentCamera
local runservice = game:GetService("RunService")
local part = workspace.Part -- change this to whatever ur part is

runservice.RenderStepped:Connect(function()
    cam.CFrame = part.CFrame
end)
3 Likes

How do I make it when it runs the player cannot move?

I want the player to not move when the script runs

Then set the WalkSpeed property inside the player’s humanoid to 0.

Thank you so much for your help!

How would I wait 3 seconds then change the camera back to the player?

Set the camera type to custom.

What do you mean by custom???

There are different camera types in roblox.
https://developer.roblox.com/en-us/api-reference/property/Camera/CameraType

just do it without any function for example:

script.Parent.MouseButton1Down:Connect(function()
local block = instance.new("Part")
end)

to:

local block = instance.new("Part")