Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

I looked it up and found nothing. Please help?

1 answer

Log in to vote
0
Answered by 6 years ago

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)
0
Only works when i set it to part. Why? QuantumScripter 48 — 6y
0
Don't know what you mean by that... starwars5251977 48 — 6y
0
The script only works when i set the subject to "part" which is a part in workspace. QuantumScripter 48 — 6y
0
You have to have it focused on a part, it can't be anything else. starwars5251977 48 — 6y
Ad

Answer this question