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

Camera isn't going to intended target?

Asked by 4 years ago

So basically I am trying to make a main menu but my player's camera won't switch over to a block I created as a camera, plz help

local Tween = game:GetService("TweenService")

local Frame = script.Parent:WaitForChild("Frame")

local Cam = workspace.CurrentCamera
local maincam = workspace:WaitForChild("1")

Cam.CameraType = Enum.CameraType.Scriptable
Cam.FieldOfView = 55

Cam.CFrame = maincam.CFrame

wait(2)
Frame.Visible = true

0
maybe try lookvector ffancyaxax12 181 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I would make the camera's CFrame inside of a part looking at your desired location as I find this way more easier. When doing this make sure your part is front face is facing your desired location and that it is anchored where you want it and you can test and tweak its position to fit your liking. The following code is how to go about it, similar to yours.

spawn(function()
    local camera  = workspace.CurrentCamera
    local camPart = workspace.camPart
    local frame = script.Parent:WaitForChild("Frame")

    camera.CameraType = "Scriptable"

    camera.CFrame = camPart.CFrame

    wait(2)
    frame.Visible = true
end)

Hopefully this helps and if it did make sure to mark it as answered. :) if you have anymore questions just comment !

0
thank you! cyanslime123 23 — 4y
0
no problem :) BigChildren 77 — 4y
Ad

Answer this question