✓ Accepted answer
Zerio, your comment is simple to fix.
Change CameraName to current workspace's camera name.
Wiki: The center of help and bugs too.
Well, guess what
there is stuff for what we dont need wiki and we need.
In this case, we don't
Let's see your code and point what i've found while reading it:
player = game.Players.LocalPlayer
character = player.Character:Clone()
character.PrimaryPart = character.Torso
character:SetPrimaryPartCFrame(player.Character.Torso.CFrame)
game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
So, the player would look like this:
local player = game.Players.LocalPlayer
Well, by myself fixing this:
local player = game.Players.LocalPlayer
modelm = Instance.new("Model", game.Workspace)
modelm.Name = player.Name
for _,item in pairs(player.Character:GetChildren()) do
item:clone().Parent = modelm
if item.ClassName == "Humanoid" then
game.Workspace:findFirstChild("CameraName").CameraSubject = modelm.Humanoid
end
end
game.Workspace:findFirstChild("CameraName").CameraType = Enum.CameraType.Custom
Hope this fixes your problem,
Thanks,
marcoantoniosantos3
5 comments
The wiki says I should use game.Workspace.CurrentCamera when editing the player's camera... your script breaks where it says game.Workspace:findFirstChild("CameraName")
You should be using Workspace.CurrentCamera, and none of marco's other edits are necessary.
Wow, adark, but my edits worked. Stop talking bad about my scripts, please.
Your edits fixed the issue, but by rewriting the entire script; the only problem was that his 'character' variable was never parented to the Workspace. You also used an outdated (and broken) method of getting the camera.
where is it broken? it works for me adark.