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 1 month 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?

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

1 answer

Log in to vote
0
Answered by
FiredDusk 1087
1 month 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 0 — 21d
Ad

Answer this question



Ad