Camera not becoming on the player once clicked a button

  1. What do you want to achieve? I’m trying to make the camera go on the player once he presses a certain button

  2. What is the issue? its not making the camera on the player but just keeping it on the main menu

  3. What solutions have you tried so far? everything i know

Here is the script

tm.Defenders.MouseButton1Click:Connect(function()

cam.CameraSubject = starterclone -- the code that makes the camera on the part

		cam.CameraType = Enum.CameraType.Custom -- the code that makes the camera on the player which is the one not functioning
		cam.CameraSubject = game.Players.LocalPlayer.Character  -- same here
end)
1 Like

Well from my testing that base script worked while setting it, There is not enough information here for me to help.

The serversided team changer has a loadcharacter() in it when you press a certain button, may that be the thing interferring with the local script? (thats another thing that may be causing the issue)

Possibly, Change it when you set the camera subject to the character to cam.CameraSubject = game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:WaitForChild("Humanoid") or game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("Humanoid")

1 Like

Same issue, its not letting the camera be on the player, just staying on the supposed position (the main menu camera)

What is the camera subject changing to? is it nil or thier character

It didn’t change at all, it still stayed on the mainmenucam part

Try printing something when you change the camera subject, does it print?

image

Is cam a defined variable? And is there some kind of waiting between setting the camera subject to starterclone and then to the character?

Have you tried setting the CameraSubject to the characters humanoid instead?

I suggested that, Although it still works, atleast from my testing

Yes, cam is defined as

local cam = workspace.Camera

No there isn’t

You have to use workspace.CurrentCamera

do workspace.CurrentCamera

AHHH

Also for best practice, when your using camera on the client set the camera variable to workspace.CurrentCamera

Let me try, might be the solution

I dont think so it doesnt really matter its just a variable to the camera being used, which is the Camera object in workspace but try it just in case

Same thing sadly, I set it to current camera

You haven’t answered a question of mine, is there some kind of waiting between setting the camera subject to starterclone and then to the character?