New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

How to make people's camera look at a specific place?

Asked by 11 days ago

Hi, I going to do something that makes people's cameras see at a specific place.

Let do some example, like the Survivor, when your team is going to eliminate someone, you'll be forced to look at a specific place, and see we're walking to the elimination hall.

I ever saw some tutorials, but it was too confusing. I know I can do it with CurrentCamera, and change the CurrentCamera angles. But- how? Do I need to use Field of View and CurrentCamera angles to change them?

Every help is appreciated. Thanks.

1 answer

Log in to vote
1
Answered by
Fifkee 1194 Moderation Voter
11 days ago
Edited 10 days ago

Set your camera's CameraType to Scriptable.

Modify it's CFrame from there:

local Camera = workspace.CurrentCamera;
local Target = workspace.Door;
Camera.CameraType = Enum.CameraType.Scriptable;
wait() --I don't know why but if you try to make immediate modifications after changing the CameraType, they will be discarded

--We'll be utilizing CFrame.new(vector3 pos1, vector3 lookat) to face the camera to the door.
Camera.CFrame = CFrame.new(Camera.CFrame.Position, Target.Position)

Field of View is simply like zooming in--it restricts or expands the field of vision depending on the current value.

Cameras have a CFrame property that allows for spatial modification.

Cheers.

0
Thanks for your answer, but it was not working, sorry :P Jack_Roblox2008 548 — 11d
0
Just remove all the semicolons as he is thinking of JavaScript and CSS lol. PrismaticFruits 73 — 10d
0
Semicolons are fine, they don't really impact your code that much. JavaScript doesn't require semicolons to compile. Fifkee 1194 — 10d
0
I used var name "Door" instead of "Target," leading to an error. Fixed the issue, sorry about the inconvenience. Fifkee 1194 — 10d
Ad

Answer this question