So i am in development of this horror game called "Friday the 13th: Deep Submersion (W.I.P)" and everything was fine until i have stumbled upon two problems. (I will define the other problem later). Anyways this problem is all about camera manipulation. I am attempting to make the camera focus on a specific part of the area until the player hits the "start" button and the focused part goes away so the player can look around once more. May someone help on this please?
COMMUNITY QUESTION
How do i make the camera focus on a certain thing then stop focusing when a player spawns?
1 answer
I would do this in a comment but may look confusing. To do this, use camerasubject. So in a localscript, make it so they camera's CameraSubject = A PART
local player = game.Players.LocalPlayer
local cam = workspace.CurrentCamera
cam.CameraSubject = workspace.Part --Find the part
And now make it so when you press the "play" button, it focuses on your character.
repeat wait() until game.Players.LocalPlayer.Character --Adding this for just in case
--find your button and everything you need up here.
--make sure this is in a local script too.
--Also, find the camera and player here
button.MouseButton1Click:connect(function()
camera.CameraSubject = player.Character:WaitForChild('Humanoid') --You could make it focus on the Character's head but we will do Humanoid.
end)
I am at school atm. I am not too sure if this will work, try it on your own,
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Alright thank you very much.