Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i press a button and make my camera look at a part?

I looked it up and found nothing. Please help?

2 comments

0

didn't work. I put it in a local script. I'm not testing the click detector part of the script yet...

1 answer

Step 1: Put a ClickDetector in a part. Step 2: Put a script in the part with the following code:

local part = game.Workspace.Part -- Replace "Part" with the name of the part.	

part.ClickDetector.MouseClick:connect(function(player)
	local cam = workspace.Camera
	cam.CameraType = "Custom"
	cam.CameraSubject = part
end)

4 comments

0

Only works when i set it to part. Why?

0

Don't know what you mean by that...

0

The script only works when i set the subject to "part" which is a part in workspace.

0

You have to have it focused on a part, it can't be anything else.

This discussion is preserved as it was. New answers, comments, and votes are closed.