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

How do i make the camera focus on a certain thing then stop focusing when a player spawns?

Asked by 7 years ago

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?

1 answer

Log in to vote
0
Answered by
FiredDusk 1466 Moderation Voter
7 years ago

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,

0
Alright thank you very much. coolboy90082 -1 — 7y
Ad

Answer this question