Camera GUI only works in Studio

(2) Stay in the game and flex your time [BETA] - Roblox

local btn = script.Parent

local sfx = script.Parent.Sound

local camera = workspace.CurrentCamera


`local frame = script.Parent.Parent

local camscript1 = game.Players.LocalPlayer.PlayerScripts.CamScript1

btn.MouseButton1Click:Connect(function()

camscript1.Disabled = true

wait (0.1)

frame:TweenPosition(UDim2.new(0, 0, 1, 0))

camera.CameraType = Enum.CameraType.Custom

sfx:Play()

end)
print "camera"
local camera = workspace.CurrentCamera

local cameraPart = workspace:WaitForChild("campart1") -- Add The Camera Part There


	camera.CameraType = Enum.CameraType.Scriptable


camera.CFrame = cameraPart.CFrame
print "done"

Can you remove the sound parts and test?

I will in a temporary gamre. 444

ok rejoin, i removed the sound

Can you try disabling the MouseButton1Click.

once again, it flickers. nothing past thart.

i will try this script in the workspace:

local camera = workspace.CurrentCamera
while wait() do


	camera.CameraType = Enum.CameraType.Scriptable
end


Something about it has broken it even in studio…

Can you show where the button script is located?

image

But this should have worked. Do you think this is a roblox bug?

Possibly. Nothing isw rong with my script, and Roblox’s email support is absolutely NO help.

Also are you sure the cam part is anchored and can collide is off?

1 Like

CanCollide is on, and it’s anchored

This is my LocalScript in my game, I adapted it for you.

I wish this work…

wait(1)
print("camera")
local camera = workspace.CurrentCamera

local cameraPart = workspace:WaitForChild("campart1")

camera.CameraSubject = workspace.campart1
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.campart1.CFrame
print("done")
1 Like

That’s some weird behaviour right there what I suggest is looping the camera CFrame change until it actually takes place

    print "camera"
    local camera = workspace.CurrentCamera

    local cameraPart = workspace:WaitForChild("campart1") -- Add The Camera Part There

    repeat wait()

    	camera.CameraType = Enum.CameraType.Scriptable
         camera.CFrame = cameraPart.CFrame


   until camera.CameraType == Enum.CameraType.Scriptable and  camera.CFrame == cameraPart.CFrame


    camera.CFrame = cameraPart.CFrame
    print "done"
1 Like

I must bump this topic. This is still an unsolved issue.

Have you tried making the script wait until the character is loaded? By that time the camera should be editable like that.

Here’s a solution for you. I tested this and it worked for me in studio and when the game was published.

Here’s the code:

print "starting camera move script"
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera

local cameraPart = workspace:WaitForChild("campart1") -- Add The Camera Part There
print("Campart found")

if player.Character then --Checking to see if the player already has a Character
	print("Character already exists")
else --runs if player.Character returns nil
	print("Character doesn't exist, waiting...")
	player.CharacterAdded:Wait() --Waiting for the character to be added
end
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPart.CFrame
print("done")

It seems like you’ve been stuck on this for a while now, so hopefully this can be the end of this thread.

1 Like