Camera not becoming on the player once clicked a button

Wait so what you are trying to do here is change the camera subject to a part, then change it back to the players character?

I think I did above, No there isn’t any

No, it starts out like this, the part is the camerasubject and then when you press a button the player’s character becomes the camerasubject

  1. make sure this is a local script
  2. is there any console information? errors?

Try adding one, like a task.wait between them

It is a local script and no there isn’t any

Theres nothing inherently wrong with that code. Theres something missing

yea do the task.wait() between them and set it to the Character humanoid instead of the character object, thats how roblox does it

image

Like this right?

task.wait()
cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

try this to be sure its not changing back after

cam:GetPropertyChangedSignal(“CameraSubject”):Connect(function()
print(“Camera changed!”)
end)

I tried that, that didn’t print anything but I saw in the camera’s properties, the camerasubject is at the Humanoid

After trying a bit I removed the “connect function” and it printed “camera changed”
image
image

I found the solution!, it was because the code which was making the mouse move with the camera was interferring with the camera’s CFrame, Special thanks for everyone who was helping me and I’m sorry if i was being a pain

2 Likes

Glad you were able to get it to work

1 Like

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