Camera not resetting after pressing a button

  1. What do you want to achieve? Keep it simple and clear!
    Camera resetting after pressing a button
  2. What is the issue? Include screenshots / videos if possible!

Camera doesn’t reset after pressing a button.

image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Using a server script and a remote, a lot of stuff related to the cameratype and it all didn’t work. Of course I looked on Developer Hub.

local plr = game:GetService("Players").LocalPlayer
local cam = workspace.CurrentCamera
local camPart = game:GetService("Workspace").Map.Play.PlayCam

script.Parent.MouseButton1Click:Connect(function()
	game.Workspace.Camera.CameraType = Enum.CameraType.Custom
	game.Workspace.Camera.CameraSubject = plr.Character:WaitForChild("Humanoid")
	cam.CameraType = Enum.CameraType.Custom
	cam.CameraSubject = plr.Character:WaitForChild("Humanoid")
end)

Try using Activated instead of MouseButton1Click and make sure that Active is set to true on the button

Didn’t work, same result. ffffffffffffff

Is the Button Active set to true?

Yes, it is.

(thirtycharactersrequired)

Try this

cam.CameraType = "Custom"

Also this didn’t work, got no idea why.

local plr = game:GetService("Players").LocalPlayer
local cam = workspace.CurrentCamera
local camPart = game:GetService("Workspace").Map.Play.PlayCam

script.Parent.MouseButton1Click:Connect(function()
        print("camerasetting")
	camera.CameraSubject = localplayer.Character.Humanoid
	camera.CameraType = "Custom"
end)

Didn’t work too. I changed it to use the variables, but it still doesn’t work

Did you get anything in the output such as camerasetting

Yes, it does in fact show up in the output.

This is in a local script right?
And i know you changed the variables but do this one more time.

local plr = game:GetService("Players").LocalPlayer
local cam = workspace.CurrentCamera
local camPart = game:GetService("Workspace").Map.Play.PlayCam

script.Parent.MouseButton1Click:Connect(function()
        print("camerasetting")
	cam.CameraSubject = game:GetService("Players").Localplayer.Character.Humanoid
	cam.CameraType = "Custom"
end)

Don’t change anything, if that does not work try this

local plr = game:GetService("Players").LocalPlayer
local cam = workspace.CurrentCamera
local camPart = game:GetService("Workspace").Map.Play.PlayCam

script.Parent.MouseButton1Click:Connect(function()
        print("camerasetting")
	cam.CameraSubject = game:GetService("Players").Localplayer.Character:WaitForChild("Head")
	cam.CameraType = "Custom"
end)

Try adding cam.CFrame = plr.Character.Head.CFrame

1 Like

Yeah, um that worked, thank you so much.

2 Likes

Which one worked? Just want to know for the future.

The 2nd one, but it says that Localplayer is not a valid member of players, but it works.

1 Like

Oh, just put Localplayer as LocalPlayer, i made a capital mistake

1 Like

It’s alright, it still worked and thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.