#how do i change camera position to a fix position
38 messages · Page 1 of 1 (latest)
oh nvm lol
actually nvm
ok code
`local plr = game:GetService("Players").LocalPlayer
local Camera = game:GetService("Workspace").CurrentCamera
local function setcam(part)
Camera.CameraType = "Scriptable"
Camera.CFrame = part.CFrame
end
setcam(workspace.SpawnLocation)`
source for code is roblox studio forums
have a table of locations
local parttable = {workspace.part, workspace.part2, workspace.part3}
local currentpart = 1
local button1 = button1location
local button2 = button2location
local player = game.Players.LocalPlayer
local cam = workspace.CurrentCamera
local function setcam(part)
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = part.CFrame
end
--cycle up
button1.MouseButton1Click:Connect(function()
if parttable[currentpart + 1] then
currentpart = currentpart + 1
setcam(parttable[currentpart])
end
end)
--cycle down
button2.MouseButton1Click:Connect(function()
if parttable[currentpart - 1] then
currentpart = currentpart - 1
setcam(parttable[currentpart])
end
end)
what does any of that mean
and then just have a number for current
basically currentpart is a number
you can get a value in a table by doing table[number]
ok....
so we just increase currentparts number or decrease every time u click
clearly u dont have 5 years experience
1 sec
and uhh isnt it supposed to be 2 gui things??? i dont really want to make it global but k
edited it
how so
circled part is parts i copy and pasted in
button1 and button 2 were alr there
wait
actually now that i look at it its just the currentpart thing
1 sec
edited again
u gotta make these 2 the locations of ur button
for example
local button1 = script.Parent.Button
i was going to do that after we fixed the current part thing
o
ping me if u need smn