Camera Tracking Part

Quite new to scripting, hoping to create some sort of camera which a player can view which will track the part when it moves such as when the rocket goes up, the camera goes up as well.

Anyone know where I can start off, been trying to look everywhere but I can’t seem anything regarding this matter.

Alright I did some working in studio and I found out how to make it lock to the part

(oh yeah and @Pokemoncraft5290 mentioned I was giving the wrong info, thanks!)

If you want to see the result yourself, just put an Anchored part in workspace, and paste the code accordingly!

Here is the code

Making the part launch up to space:

-- should be in serverscriptservice
for i = 0, 100, 1 do
	wait()
	game.Workspace.Part.CFrame *= CFrame.new(0, 1, 0)
end

Making the camera lock to the part:

-- should be in starterplayerscripts (and also should be a local script)
local cam = workspace.Camera

cam.CameraType = Enum.CameraType.Track
cam.CameraSubject = workspace.Part

Result: https://gyazo.com/24d4ac5734bb0d37e77c495f1d94c861

The docs:

1 Like

I think that’s not the property he is looking for, focus seems to be just for where the computer focuses its effort on rendering.

You could use Cframe:LookAt every frame to have the camera point towards the object.

Set the players camera cframe to a part looking at the space ship.