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

how do i make a camera with a screen gui button?

Asked by 6 years ago

i need help to make a camera for a show i need it to be like a screen gui on the side of the screen ans when u press it u can see throught the camera

0
Viewport frames were introduced not very long ago. User#24403 69 — 6y

1 answer

Log in to vote
2
Answered by 6 years ago

ViewportFrames are not out yet in prod of Client, only stuck for Studio with no ETA on release, so I wouldn't count on them. I think what you mean is moving the camera to a new location when you click.

You can do this in your localscript in your gui Button

local button = script.Parent
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera

button.MouseButton1Click:Connect(function()
    camera.CameraType = "Scriptable"
    camera.CFrame = CFrame.new(0,0,0) * CFrame.new()-- Change these co-ordinates to the position you want the camera to be at.

    camera.Focus=CFrame.new(10,10,10) -- Set this to the position where you want the camera to look at from the original position. So, it would look in the direction from 0,0,0 to 10,0,10.

end)
3
I wouldn't suggest using strings for properties like cameratype, I'd recommend using enums instead. Enum.CameraType.Scriptable User#24403 69 — 6y
0
this is from 4 months ago u do realize... RayCurse 1518 — 5y
0
I never knew Alvinblox used this site?! PrismaticFruits 842 — 4y
Ad

Answer this question